Calculate bills

Handles the actual bill calculation. To calculate bills, the task completes these steps:

  1. Load account activities for the next batch of accounts. Depending on the run type (CDR, Interim, or Utility), the appropriate SQL query is used to load activities from the BILLING.ACCOUNTACTIVITY table.
  2. Load qualifying accounts for the account activities. For utility bill runs, also load unbilled meter readings for the accounts.
  3. For each account, create a bill and then create a line item for each activity to be billed.
  4. For each bill, set the bill date, due date, delinquent date, and billing period from and to dates.
  5. Calculate the line item amount for each unprocessed activity.

If you’re using the Bill Run InfoViewer to recalculate bills for an existing bill run, the existing calculation details are first deleted so that they can be recreated.

Invocation

The Calculate Bills stage is invoked every time you create a new bill run. You can use the Batch Manager form or the Billing Calendar to schedule a new bill run task, and you can also execute the task manually by clicking the Action button in the Batch Manager form and selecting Run.

In addition, you can use the Create Bill Run form to start a new bill run manually. Note that if you use Create Bill Run to create a new bill run, Infor Public Sector will also add a Bill Run Schedule task in the Batch Manager.

Finally, you can use the console application to start a new bill run by entering the task name, the task key, or the schedule key. For example, if you’ve scheduled a bill run task called BillRun, you would enter this command to start the task by name:

Hansen.Core.BatchManager.Console.exe -n:BillRun

To start the task by task key, you would enter this (assuming the task key is 1013):

Hansen.Core.BatchManager.Console.exe -t:1013

Or you could enter a command such as this to start the task by schedule key:

Hansen.Core.BatchManager.Console.exe -s:1009

If a bill run hasn’t been posted yet, you can also use the Bill Run InfoViewer to repeat this stage. Select the Recalculate Bills check box and click Generate.

Note that when bills are recalculated, Infor Public Sector does not include any new items added after the initial bill run. This stage recalculates existing charges only, rather than adding any new charges.

Monitoring

If the Calculate Bills stage is successful, you can expect to see a series of messages similar to these in the Bill Run log:

  • Loading AccountActivities for batch of Accounts.
  • [#] AccountActivities have been found.
  • Utility Run -> Loading unbilled meter readings for batch of Accounts.
  • [#] Unbilled Water Meter Readings have been found.
  • Qualifying Account(s) have been found.
  • Calculating Bills for [#] accounts.

If recalculating:

  • ReCalculation Phase started.
  • ReCalculation Phase ended successfully.
  • or
  • ReCalculation Phase ended with errors.

In the BILLRUN table, the PROCESSINGFLAG and CALCULATINGFLAG columns are set to Y while this stage is running, and changed to N when the process is finished. If this is the first time bills have been calculated for this run, the CALCULATEDFLAG column in the BILLRUN table is also set to Y when the process is complete.

The task also adds a record to the BILLRUNACTIVITY table with ACTIVITYTYPE = 1 (CalculateBills) when this stage is finished. If you’re recalculating bills for an existing bill run, you should also find a BILLRUNACTIVITY record with ACTIVITYTYPE = 6 (ReCalculate)

Data output

This table lists the database tables in which this stage adds or updates records:

TableCommentsReview
BILLING.ACCOUNTACTIVITYAdds bill keys and line item keys to account activity records.Not displayed in Infor Public Sector interface
BILLING. ACCOUNTTRADEWASTEIf trade waste services are billed, sets the BILLEDFLAG column to Y and adds the line item key to the LINEITEMKEY column.Manage Account page
BILLING. ACCTHISTUSAGEDETAILAdds a record for each metered service that is billed, specifying the service key, the line item key, the usage, and the usage date.Manage Account page
BILLING.ADDRESSSERVICESets the FIXEDCHGFROMDATE and FIXEDCHGTODATE columns for fixed charge services.Manage Account page
BILLING.BILLStores bill records.Bill InfoViewer
BILLING.LINEITEMStores line item records.Bill InfoViewer, Line Item InfoViewer
BILLING. LINEITEMIMPERVIOUSAREAStores calculation details for line items involving impervious areas.Line Item InfoViewer
BILLING.LINEITEMRATELinks line items to rate table calculation details.Line Item InfoViewer
BILLING. LINEITEMTRACKEDREADLinks line items to water tracked readings.
BILLING. WATERTRACKEDREADINGIndicates which water meter readings have been billed.Account Service InfoViewer (click service name link in Manage Account page)
RESOURCES.RATETABLE. CALCULATIONDETAILStores details of the rate table calculations for each line item.Line Item InfoViewer