import os

import cfgtools

hide_unpriced_items_from_total_report = None


def get_hide_unpriced_items_from_total_report():
    # type: (...) -> bool

    global hide_unpriced_items_from_total_report

    if hide_unpriced_items_from_total_report is None:
        config = cfgtools.read(os.environ["LOADERCFG"])
        hide_unpriced_items_from_total_report = config.find_value("Customizations.HideUnpricedItemsFromTotalReport") or "true"

    return hide_unpriced_items_from_total_report.lower() == "true"
