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.
-
If the user does not have access to the account
-
If the FREEZE_COMPLETE_SW on the Bill Correction Type is 'N'
-
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'.
-
Any unexpected exception occurs.
-
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
-
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'.
