M8-R17: allocate thermal standing costs by service
This commit is contained in:
@@ -1230,7 +1230,24 @@ def _thermal_cost_getter(metric: str, window: str | None) -> Callable[[Session],
|
||||
if metric == "water_tax":
|
||||
return result["breakdown"]["hot_water_tax"]
|
||||
if metric == "hot_water_total":
|
||||
return result["breakdown"]["hot_water_heating"] + result["breakdown"]["hot_water"]
|
||||
# Keep the existing component entities variable-only, while making
|
||||
# the two consumer-facing totals partition the all-in summary.
|
||||
# Standing costs are assigned by their contractual commodity:
|
||||
# hot-water network belongs to hot water; the remaining named
|
||||
# standing fees belong to heating.
|
||||
return (
|
||||
result["breakdown"]["hot_water_heating"]
|
||||
+ result["breakdown"]["hot_water"]
|
||||
+ result["breakdown"]["hot_water_tax"]
|
||||
+ result["fixed_breakdown"]["hot_water_network"]
|
||||
)
|
||||
if metric == "heating":
|
||||
return result["breakdown"]["heating"] + sum(
|
||||
(result["fixed_breakdown"][key] for key in (
|
||||
"heating_network", "metering", "delivery_set", "other"
|
||||
)),
|
||||
0,
|
||||
)
|
||||
return result["breakdown"][metric]
|
||||
return _getter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user