Documentation >
MAC-PAC Technical Library >
Distribution >
Order Processing >
Programs >
Credit Checking - Purpose >
Credit Checking - Calculations
Credit Checking - Calculations
CRDCHK
A. Housekeeping
1. Key lists and parameter lists are defined.
2. Work fields are defined and initialized.
3. Sales order hold codes are retrieved from Reference File category 402 and placed in hold code arrays.
4. System options are retrieved from Reference File category 133 to determine the currency/customer level.
5. If the currency/customer level is global, customer defaults are retrieved from Reference File category 029. This record determines whether credit checking should use the on-order or on-reserve balance in determining the total commitment amount.
6. The order processing defaults are retrieved from Reference File category 413.
7. Credit check types are retrieved from Reference File category D37 and loaded into check type arrays.
B. Mainline
1. If the currency/customer level is not global, the customer defaults are retrieved for the company or company/location. These defaults determine if the on-order or on-reserve balance should be used to calculate the customer's total commitment.
2. From the input parameters, the key for chaining to the Customer Master file (ARCUSTL9) is primed.
3. If the customer record is found, the program looks up the credit check types array to determine the type of credit checking to be performed.
4. If the customer record is not found, the program ends.
5. If the current hold code is not EDI Order hold (I), the customer hold flag is checked. If the flag is set to Y and the current hold code is not Administrative (A) or EDI Price hold (P), a customer hold will be passed back to the calling program. If the current hold is EDI Order hold, credit checking is not performed.
6. The program determines which credit checks to perform:
a. A/R Limit
(1) The program determines whether A/R days or A/R amount should be checked. If corporate credit checking is used, the value is retrieved from the corporate customer. Otherwise, the value is retrieved from the customer being evaluated.
(2) For A/R Days
(a) The oldest invoice is retrieved from the Customer Master file.
(b) The number of days overdue is determined.
(c) If no invoices are found, the days over limit is set to zero.
(d) If the customer is over the A/R limit, a past due A/R hold is returned to the calling program if the current hold code is not Administrative (A) or EDI Price (P). If corporate credit checking is used, the corporate customer's A/R days overdue limit will be used. Otherwise, the program will use the limit of the customer being evaluated.
(e) If corporate credit checking is used and an open item was not found for the customer being evaluated, open items will be reviewed for the corporate customer and all other subsidiaries of the corporate customer. The items will be reviewed to determine if any of them are past due.
(3) For A/R Amount:
(a) If corporate credit checking is not used, the past due balance of the customer being evaluated is compared to the customer's A/R limit. If the past due balance is greater than the limit, a past due A/R hold code is returned to the calling program if the current hold code is not Administrative (A) or EDI Price (P).
(b) If corporate credit checking is used, the past due balances will be summed for the corporate customer and all associated child customers. This balance will then be compared against the corporate customer's A/R limit. If the total past due balance is greater than the limit, a past due A/R hold will be returned to the calling program if the current hold code is not Administrative (A) or EDI Price (P).
b. Credit Limit
(1) If corporate credit checking is not used, the total commitment for the customer being evaluated is calculated as follows:
On-order Amount or On-reserve Customer Balance (based on Reference File category 029)
plus Credit Amount (passed to the program for the order)
plus Customer A/R Balance
plus Customer Not Due Drafts Balance
plus Pending Invoice Balance
minus On-account Balance
If the total commitment is greater than the customer's credit limit, a credit hold code is returned to the calling program if the current hold code is not Administrative (A), EDI Price (P), or A/R Limit (C).
(2) If corporate credit checking is used:
(a) The corporate customer and all associated child customers are retrieved. The following fields are accumulated for all customers:
· On-order Amount or On-Reserve Customer Balance (based on category 029)
· Pending Invoice Balance
· Not Due Drafts Balance
· On-Account Balance
(b) The total commitment is calculated as
Total On-Order on On-Reserve
plus Credit Amount (passed to the program for the order)
plus Total A/R Balance
plus Total Not Due Drafts Balance
plus Total Pending Invoice Balance
minus Total On-account Balance
(c) If the total commitment is greater than the corporate customer's credit limit, a credit hold is returned to the calling program if the current hold code is not Administrative (A), EDI Price (P), or A/R Limit (C).
c. Order Limit
(1) The program checks whether the total order amount is greater than the customer order limit. If it is, an order limit hold is returned to the calling program if the current hold code is not Administrative (A), EDI Price (P), A/R Limit (C), or Credit Limit (D).