M8-R17: allocate thermal standing costs by service

This commit is contained in:
2026-08-28 14:24:57 +02:00
parent 6e197d7808
commit 5e1545efad
4 changed files with 90 additions and 4 deletions
+18 -1
View File
@@ -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