Purge Aged Invoices (invoice_purge_job)
Module Name |
invoice_purge_job |
Description |
Purge Aged Invoices |
Functional Area |
Invoice Matching |
Module Type |
Admin - Ad hoc |
Module Technology |
Background Processing |
Catalog ID |
N/A |
Wrapper Script |
b8dwrap.ksh |
Design Overview
This background job is composed of two steps processing. It will have a threading assignment and a business logic processing.
Thread assignment program will filter eligible records from invoice header table based on its purge criteria from system parameter settings. The Order History Months parameter will determine the number of months older than month ages between current date and invoice match date, invoice date (if match date is not available). These old posted invoices that have not already been purged by Order Purge Job (invoices associated to an order) will be included for deletion. This includes all types of invoices-non-merchandise, credit notes, credit note requests, debit memos, and consignment invoices. Regular merchandise invoices will primarily be deleted through order purge job but will be deleted by this job if they still exist in the system. This program deletes only from the RMFCS invoice tables preceded with 'INVC'. These records are chunked and Thread ID is assigned for each. They will be stored temporarily in a staging table.
The Business logic program will process all records from the staging table. Using bulk processing, this program will delete the records from invoice-related tables by calling INVC_SQL.DELETE_INVC. It will free up and clean the staging table afterwards. There is a STOP ON NEXT feature in bulk processing (through a loop) where Administrators can stop this batch with a flip of this indicator.
Key Tables Affected
Table 10-2 Key Tables Affected
Table | Select | Insert | Update | Delete |
---|---|---|---|---|
PERIOD |
Yes |
No |
No |
No |
PURGE_CONFIG_OPTIONS |
Yes |
No |
No |
No |
RMS_BATCH_STATUS |
Yes |
No |
No |
No |
B8D_PROCESS_CONFIG |
Yes |
No |
No |
No |
JOB_AUDIT_LOGS |
No |
Yes |
No |
No |
B8D_INVOICE_PURGE_STG |
Yes |
Yes |
No |
Yes |
INVC_HEAD |
Yes |
No |
No |
Yes |
SA_TRAN_HEAD |
Yes |
No |
No |
No |
SHIPSKU |
Yes |
No |
No |
No |
INVC_DETAIL |
No |
No |
No |
Yes |
INVC_NON_MECH |
No |
No |
No |
Yes |
INVC_MERCH_VAT |
No |
No |
No |
Yes |
INVC_DETAIL_VAT |
No |
No |
No |
Yes |
INVC_DISCOUNT |
No |
No |
No |
Yes |
INVC_TOLERANCE |
No |
No |
No |
Yes |
ORDLOC_INVC_COST |
No |
No |
Yes |
No |
INVC_MATCH_QUEUE |
No |
No |
No |
Yes |