import os

import cfgtools

tef_on_bordereau = None


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

    global tef_on_bordereau

    if tef_on_bordereau is None:
        config = cfgtools.read(os.environ["LOADERCFG"])
        tef_on_bordereau_config = config.find_value(
            "Customizations.ConsidersTEFOnBordereau",
            "false",
        ).lower() == "true"
        tef_on_bordereau = tef_on_bordereau_config == "true"

    return tef_on_bordereau
