diff --git a/domain/sap10_calculator/calculator.py b/domain/sap10_calculator/calculator.py index 45dbb921..ff634c8f 100644 --- a/domain/sap10_calculator/calculator.py +++ b/domain/sap10_calculator/calculator.py @@ -300,6 +300,13 @@ class CalculatorInputs: fuel_cost: FuelCostResult = field( default_factory=lambda: _ZERO_FUEL_COST_RESULT ) + # Table 32 standing charges (electric off-peak high-rate code + + # mains gas) — added to `total_cost` when the calculator's off- + # peak fallback path fires. STANDARD-tariff certs route through + # `fuel_cost.additional_standing_charges_gbp` instead and ignore + # this field. cert_to_inputs sets this via `additional_standing_ + # charges_gbp(main_fuel_code, water_heating_fuel_code, tariff)`. + standing_charges_gbp: float = 0.0 @dataclass(frozen=True) @@ -518,6 +525,7 @@ def calculate_sap_from_inputs(inputs: CalculatorInputs) -> SapResult: + hot_water_cost + pumps_fans_cost + lighting_cost + + inputs.standing_charges_gbp - pv_credit, ) ecf = energy_cost_factor(total_cost_gbp=total_cost, total_floor_area_m2=tfa) diff --git a/domain/sap10_calculator/rdsap/cert_to_inputs.py b/domain/sap10_calculator/rdsap/cert_to_inputs.py index db1ac05f..69b46f15 100644 --- a/domain/sap10_calculator/rdsap/cert_to_inputs.py +++ b/domain/sap10_calculator/rdsap/cert_to_inputs.py @@ -3405,6 +3405,15 @@ def cert_to_inputs( other_fuel_cost_gbp_per_kwh=_other_fuel_cost_gbp_per_kwh( _rdsap_tariff(epc), prices ), + # Table 32 standing charges for the off-peak fallback path. + # STANDARD-tariff certs route via `fuel_cost.additional_ + # standing_charges_gbp` (set inside `_fuel_cost`) and the + # calculator ignores this scalar on that path. + standing_charges_gbp=additional_standing_charges_gbp( + main_fuel_code=_main_fuel_code(main), + water_heating_fuel_code=_water_heating_fuel_code(epc), + tariff=_rdsap_tariff(epc), + ), co2_factor_kg_per_kwh=_co2_factor_kg_per_kwh(main), # SAP10.2 Table 12d (p.194) per-end-use effective CO2 factors. For # electricity end-uses Σ(kWh_m × CO2_m) / Σ(kWh_m) replaces the