Project

General

Profile

Bug #2933

Report: Electricity Bill vs Energy Consumed (Cost per Unit) — station-wise & all-stations, month/year

Added by Piyush Vijay about 2 months ago. Updated about 2 months ago.

Status:
New
Priority:
Normal
Start date:
08/05/2026
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

Purpose
A new operational report that compares, per period, the actual electricity bill (₹) paid for a station against the energy consumed/delivered (kWh) at that station — so finance/ops can see the real cost of electricity vs the units delivered and spot anomalies (over-billing, leakage, meter issues, tariff changes). Because the two are in different units (₹ vs kWh), the report also derives an Average Cost per Unit (₹/kWh), which is the headline, human-readable metric.

Data sources (no new data entry — reuses monthly closing data)

Electricity Bill (₹): the actual "Electricity Expense" ledger amount entered during monthly closing (station_monthly_revenue_versioned_snapshots → ..._ledger_amounts, ledger = Electricity Expense). One active snapshot per station×month.
Energy Consumed (kWh): the same snapshot's total_energy_kwh (keeps bill & energy on the exact same period/basis).
Views / filters

Granularity: Month or Year.
Station filter: optional — one station, or all stations (no selection needed).
Period filter: year, and optional single month.
All-stations combined: per-period totals across every station, plus a grand total.
Columns (user-friendly)

Column Meaning
Period e.g. "Aug 2026" (month) / "2026" (year)
Station station name (or "All Stations" in the combined rows)
Energy Consumed (kWh) units delivered in the period
Electricity Bill (₹) actual bill paid (from monthly closing)
Avg Cost per Unit (₹/kWh) Electricity Bill ÷ Energy Consumed — the key comparison metric
Sessions charging sessions in the period
Bill Recorded? Yes/No — whether the electricity bill was entered for that month's closing
Notes

"Difference" between bill and energy is expressed as ₹/kWh (units differ, so a straight subtraction is not meaningful).
If a month's closing has no electricity ledger entry, bill = ₹0 and "Bill Recorded? = No" (so users know it's missing, not truly zero).
Access: same permission as Station Monthly Revenue (stations.monthly_revenue.view).

#1

Updated by Shreya Agarwal about 2 months ago

Today, I completed the development of the Electricity Cost Analytics report from the frontend side. This report compares the actual electricity bill (₹) paid for a station against the energy consumed (kWh) and derives the average cost per unit (₹/kWh). The report includes station-wise and all-stations views with month/year granularity filters.
implemented the complete UI with station, year, and month filters, and integrated the report data from the backend API. The report displays key metrics including Energy Consumed, Bill Energy, Difference, Electricity Bill, and Cost Per Kwh in a clean table format. I ensured the data displays exactly as received from the API without any sorting, removed unnecessary components like stat cards and action columns, and updated the info modal with proper documentation. The page is now fully functional and follows the same design pattern as the existing project report.

#2

Updated by Shreya Agarwal about 2 months ago

Today I completed multiple enhancements and cleanups on the Electricity Cost Analytics report page.
I removed unnecessary columns from the table including Cost Per Kwh, Sessions, and Bill Recorded? as they were not needed for the current view, reducing the table from 10 columns to 7 columns for a cleaner and more focused display.
I also removed the corresponding StatCards from the Row Detail Dialog and Info Modal to maintain consistency across the UI.
Fixed the Difference column color logic to follow universal standards where positive values now display in green and negative values in red, and removed the plus sign from positive values to match the API response format.
Additionally, I removed pagination since the API does not support it, added a clickable station name feature that opens the Station Details Panel, and performed a full code cleanup by commenting out unused variables and functions.
The page is now fully functional, displays data in API order without sorting, and matches the reference design patterns.
Also learning continue react js for better understanding

Also available in: Atom PDF