Documentation >
MAC-PAC Technical Library >
Financial >
Accounts Receivable >
Programs >
Expected Payments Report - Purpose >
Expected Payments Report - Calculations
Expected Payments Report - Calculations
AR190E
A. Housekeeping
1. Parameter lists and key lists needed by the program are defined. Program variables and work fields are defined and initialized.
2. Retrieve the system currency level flag from Reference File category 133.
3. The date format record is retrieved from the Reference File (category 049). If this record is not found, a message is sent to the system operator and the date format defaults to MMDDYY.
4. Retrieve company name from Reference File category 002.
B. Mainline
1. A priming read is executed and the lower limit is set on the input file. If no data is found an error message is sent to the error message file (AR120CP1).
2. The expected payment date for each open item is written to the temporary file (AR120CP2) along with customer information. Only open items with due dates less or equal to cutoff date are processed. To calculate the expected date the average time a customer takes to pay has to be added to the open invoice accounting date if the open item is not overdue yet. If the open item was already dunned, a new expected date has to be calculated. Use the following for calculation the expected date:
A. If open item has been dunned
Expected Date = Last dunning date + Limit days (category 352)
B. If the open item is overdue but has not been dunned
Expected Date = System Date + Grace period (category 351) +
Limit days (category 352) for dunning level 1
3. The discount percentage for each open item is calculated along with the net amount based on the gross amount and the discount amount.
4. The expected payment date is compared with the discount date. If the expected date is less than or equal to the discount date, the expected amount is set equal to the net amount. If the expected date is greater than the discount date, the expected amount is set equal to the gross amount.
5. The temporary file (AR120CP2) is updated with the calculated information.
6. Once all records are calculated, process a priming read on the temporary file (AR120CP2).
7. The Grand Total line is initialized, formatted, and written.
8. The Totals for Dunning Level 9 are initialized, formatted, and written.
9. The end of report line is written.