from sysactions import get_storewide_config

must_print_delivery_coupon_config = None


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

    global must_print_delivery_coupon_config

    if must_print_delivery_coupon_config is None:
        config = get_storewide_config("Store.DeliveryConfig.PrintDeliveryCoupon", defval="true")
        must_print_delivery_coupon_config = config.lower() == "true"

    return must_print_delivery_coupon_config
