C1-BLCORBLGN

This algorithm is invoked when a bill correction enters the Bill Regeneration status. It executes the below logic:

  • If the number of bill segments to be regenerated is greater than the online record process limit, then the status of the bill correction is changed to Deferred Bill Regeneration and the algorithm exits processing.

  • If the number of bill segments to be regenerated is not greater than the online record process limit, then the algorithm performs online regeneration of all the eligible bills in the bill correction. An error is logged in the C1_​BILL_​CORR_​EXCP table and C1_​BILL_​CORR_​BILL is updated with BILL_​CORR_​REGEN_​ST_​FLG as 'Error In Bill Regeneration' if any of the below conditions are satisfied.

    1. If the user does not have access to the account

    2. If the FREEZE_​COMPLETE_​SW on the Bill Correction Type is 'N'

    3. If the account already has a non-adhoc/cyclic pending bill but with a different cutoff date

While regeneration, the accounting date is set to the process date/current date. A new bill exists already and is completed then BILL_​CORR_​REGEN_​ST_​FLG is changed to 'Processed' without further processing for the bill. Otherwise, the bill completion is performed. If a new bill does not exist, then a bill is generated and frozen on the account for the cut-off date fetched from the table C1_​BILL_​CORR_​BILL.

If any exception occurs in the above process, then an error is logged in the C1_​BILL_​CORR_​EXCP Table and C1_​BILL_​CORR_​BILL is updated with BILL_​CORR_​REGEN_​ST_​FLG as 'Error in Bill Regeneration'.

During the bill regeneration process, if any of the below occurs, then an error is logged in the C1_​BILL_​CORR_​EXCP Table and C1_​BILL_​CORR_​BILL is updated with BILL_​CORR_​REGEN_​ST_​FLG as 'Error in Bill Regeneration'.

  1. Any unexpected exception occurs.

  2. If a new bill is created and if either none of the bill segments were created or if it has any incomplete or error bill segments

  3. If the new bill was not generated

If the process is completed then C1_​BILL_​CORR_​BILL is updated with the new bill ID and BILL_​CORR_​REGEN_​ST_​FLG is updated as 'Bill Regeneration In Progress'. If the FREEZE_​COMPLETE_​SW is 'Y', then the bill is frozen and completed using a bill date which is the most recent bill date of account or the current date, whichever is the latest. If the bill is completed successfully, C1_​BILL_​CORR_​BILL is updated with BILL_​CORR_​REGEN_​ST_​FLG as 'PRCD'. However, if the bill is not completed, an error is logged in the C1_​BILL_​CORR_​EXCP Table according to the segments and C1_​BILL_​CORR_​BILL is updated with BILL_​CORR_​REGEN_​ST_​FLG as 'Error in Bill Regeneration'.

If all the bill records for the bill correction are generated successfully then the bill correction status is set to 'Processed' else it is changed to 'Error in Bill Regeneration'.