Merge pull request #162 from Hestia-Homes/new-reporting

ensuring we adjust bills
This commit is contained in:
KhalimCK 2026-01-07 22:58:22 +00:00 committed by GitHub
commit bd7a30808a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -35,7 +35,8 @@ export async function getAverages(
e.lighting_cost_current +
e.appliances_cost_current +
e.gas_standing_charge +
e.electricity_standing_charge
e.electricity_standing_charge -
COALESCE(e.installed_measures_total_energy_bill_adjustment, 0)
)::float AS avg_bills,
AVG(e.primary_energy_consumption)::float AS avg_energy_consumption
FROM property p
@ -56,7 +57,8 @@ export async function getTotals(portfolioId: number): Promise<TotalMetrics> {
e.lighting_cost_current +
e.appliances_cost_current +
e.gas_standing_charge +
e.electricity_standing_charge
e.electricity_standing_charge -
COALESCE(e.installed_measures_total_energy_bill_adjustment, 0)
)::float AS total_bills
FROM property p
LEFT JOIN property_details_epc e ON e.property_id = p.id