Skip to main content

Billing System

billcyclecreation.png3. Bill Schedule Configuration: Defines when bills should be generated .

Access Path: Navigate to Bill Schedule → Schedule tab → Add Bill Schedule

Required Schedule Parameters:

  • Bill Cycle: Select from previously created bill cycles
  • Bill Template: Select from previously created bill templates
  • Schedule Start Date: Date when the bill generation should start
  • Time: Specific time when the bill generation should execute
  • Is Recurring: Whether this is a one-time or recurring schedule
  • First Bill Date: Date when the first bill should be generated
  • Invoice Start Date: Beginning of the billing period for consumption calculation
  • Invoice End Date: End of the billing period for consumption calculation

Process Steps:

  1. Click "Add Bill Schedule" button from the Schedule tab
  2. Select the appropriate Bill Cycle and Bill Template from the dropdowns
  3. Configure the schedule parameters including start date and time
  4. Set recurrence settings if applicable
  5. Specify billing period dates
  6. Click "Submit" to create the schedule

Developer Notes:

  • Schedules are stored in the bill_schedules table
  • Recurring schedules trigger automatic job creation in the task scheduler
  • The system validates that invoice start and end dates align with the billing frequency

Screenshot 2025-03-21 122430.png

 

4. Bill Generation Process Execution

When a scheduled bill run executes, the system follows this technical process:

4.1. Component Data Collection Sequence

The system collects data through the following component pipeline:

Bill_Component

├── UtilityDetailComponent

│   └── Fetches utility configuration (name, tax info, rate types)

├── ConsumerDetailComponent

│   └── Retrieves consumer details (IDs, plans, activation dates, meters)

├── PlanDetailComponent

│   └── Obtains rate plans and billing frequencies

├── RateDetailComponent

│   └── Processes rate configurations (fixed, variable, tiered rates)

├── BillDetailComponent

│   └── Processes historical bill data and calculates due dates

├── MeterDetailComponent

│   └── Fetches meter information (IDs, types, device details)

├── MeterReadingComponent

│   └── Retrieves current and previous meter readings

├── ConsumptionDetailComponent

│   └── Calculates consumption based on meter readings

├── PaymentsDetailComponent

│   └── Processes payment history and totals

└── OutstandingDetailComponent

    └── Calculates outstanding balances from previous bills

Each component populates two key data structures:

  • calculation_specific_data: Component-specific calculations and intermediate values
  • bill_json_data: Structured data that will form the final bill

5. Bill Run Monitoring

After a bill run has executed, bills can be monitored and managed from the Run tab:

Run Tab Columns:

  • Invoice No: Unique bill identifier
  • Invoice Date: Date when the bill was generated
  • Consumer: Name of the consumer
  • Mobile No: Consumer's contact number
  • Bill Amount: Total amount due
  • Status: Current status (Generated, Sent, Paid, etc.)
  • Bill Type: Classification (Regular, Estimated, Final)
  • Action: Available operations (View, Edit, Download, Send)

Process Steps:

  1. Navigate to Bill Schedule → Run tab
  2. View the list of bill runs with their execution statuses
  3. Click on a specific run to view all bills generated in that run
  4. Use action buttons to manage individual bills or perform bulk actions

Screenshot 2025-03-21 122430.png

Technical Implementation Details

Class Hierarchy

The bill generation process relies on the following class hierarchy:

BaseBillCreationClass

├── ComponentManager

│   ├── UtilityDetailComponent

│   ├── ConsumerDetailComponent

│   ├── PlanDetailComponent

│   ├── RateDetailComponent

│   ├── BillDetailComponent

│   ├── MeterDetailComponent

│   ├── MeterReadingComponent

│   ├── ConsumptionDetailComponent

│   ├── PaymentsDetailComponent

│   └── OutstandingDetailComponent

└── CalculationManager

    ├── BaseCalculatorComponent

    ├── RoshanCalculatorComponent

    └── AxisCalculatorComponent

5. Printing & Distribution:

  •  Tracks delivery of paper and electronic bills.


Data Flow Diagram

Bill Run Trigger

BaseBillCreationClass initialization

Component Data Collection

Calculation Process

Bill JSON Generation

Bill Storage & Distribution