Project

General

Profile

Bug #3264

Charging Station Management (Edit Station > Expenses Tab) - Add "Electricity Expense" as a Default Monthly Expense in All Existing Stations and Every New Station Created

Added by Shreya Agarwal 7 days ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Start date:
10/07/2026
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

Currently, when a user navigates to Edit Charging Station → Expenses tab, the "Monthly Expense Config" section is empty and shows the message "No expenses configured. Click 'Add expense' to add one." The user must manually click the "+ Add expense" button and select the expense type from the dropdown every single time.
"Electricity / EB Charges" should be added as a default monthly expense row whenever the Expenses tab is opened — for all existing stations and for every new station created. The user should still be able to edit the amount, add remarks, or delete the row if needed.

#1

Updated by Shreya Agarwal 7 days ago

In the Charging Station Management module, the Expenses tab in the Edit Charging Station modal was updated to display the electricity expense row ("Electricity / EB Charges") by default with an initial amount of 0 whenever the tab is opened, matching the required configuration for all existing and newly created stations. To fulfill the requirement dynamically without hardcoding any ledger identifiers, helper functions were introduced to dynamically identify the electricity ledger from the master ledger API response and verify whether it already exists among the station's configured expenses. The data retrieval logic was consolidated into a single synchronized call (loadExpensesData) that loads master ledgers and station accounts concurrently while maintaining a stable hook dependency reference, which resolves and prevents infinite API re-fetching loops in the Network tab.

Also available in: Atom PDF