(
        domain, case_id, product_id, window_end,
        section_id=const.SECTION_TYPE_STOCK, configuration=None)
return compute_daily_consumption_from_transactions(transactions, window_start, configuration)
Computes the consumption for a product at a supply point.

    Can optionally pass a section_id, but by default the 'stock'
    value is used for computation.

    Returns None if there is insufficient history.
Computes the consumption for a product at a supply point.
Computes the consumption for a product at a supply point .
def compute_daily_consumption(
        domain, case_id, product_id, window_end,
        section_id=const.SECTION_TYPE_STOCK, configuration=None):
    """
    Computes the consumption for a product at a supply point.

    Can optionally pass a section_id, but by default the 'stock'
    value is used for computation.

    Returns None if there is insufficient history.
    """
    from corehq.form_processor.interfaces.dbaccessors import LedgerAccessors

    configuration = configuration or ConsumptionConfiguration()
    window_start = window_end - timedelta(days=configuration.max_window)
    transactions = LedgerAccessors(domain).get_transactions_for_consumption(
        case_id,
        product_id,
        section_id,
        window_start,
        window_end
    )
    return compute_daily_consumption_from_transactions(transactions, window_start, configuration)
def compute_daily_consumption ( domain , case_id , product_id , window_end , section_id = const . SECTION_TYPE_STOCK , configuration = None ) : from corehq . form_processor . interfaces . dbaccessors import LedgerAccessors configuration = configuration or ConsumptionConfiguration ( ) window_start = window_end - timedelta ( days = configuration . max_window ) transactions = LedgerAccessors ( domain ) . get_transactions_for_consumption ( case_id , product_id , section_id , window_start , window_end ) return compute_daily_consumption_from_transactions ( transactions , window_start , configuration )