Documentation >
MAC-PAC Technical Library >
Financial >
Accounts Receivable >
Programs >
Average Days to Pay Calculation - Purpose >
Average Days to Pay Calculation - Calculations
Average Days to Pay Calculation - Calculations
AR170E
A. Housekeeping
1. Parameter lists and key lists needed by the program are defined. program variables and work fields are defined and initialized.
B. Mainline
1. A priming read is done to establish the initial position in the payment file.
2. All payment information is processed for each customer. During this, both customer and payment statistics are accumulated.
3. Customer Statistics are retrieved from the customer master file.
4. Payment dates are calculated. These are done in the Julian date format. All dates are converted from the Georgian date format to the Julian format, calculated, and then converted back.
The average days to pay calculation formula is as follows:
Average Days to Pay =
å [(Payment Date - Invoice Date)*(Payment Amount Applied)]
å [Applied Payment Amounts]
Average Days Late =
å [(Payment Date - Invoice Date)*(Payment Amount Applied)]
å [Applied Late Payment Amounts]
Note: This calculation only includes late payments and does not include payments that occurred prior to the due date.
5. The customer master file is updated with the average days to pay.
6. If an error occurs, a record is written to the error message file.