Documentation >
MAC-PAC Technical Library >
Distribution >
Purchasing >
Programs >
Vendor Allocation Update - Purpose >
Vendor Allocation Update - Calculations
Vendor Allocation Update - Calculations
PO280E
A. Housekeeping
1. Parameter and key lists are established, fields are defined and initialized, Help and Error Message information is retrieved, and general information about company/warehouse/date/vat processing/and currency is retrieved from Reference file (REFERP).
B. Mainline
1. If records are found on the Vendor Allocation Process Request file (PO370AP), the information is read by the system and the appropriate report information is set up.
2. The program takes one record (from PO370AP) to be processed. For each record, the program reads the Part Logical file (DE100L27). The Horizon Date is calculated for each of these records associated with a specific date. For each part taken from the Requisition Master file (PO160M1) the following operations are performed: the Order Date Calculation (Order Date = Due Date - Rec. Limits), and the Quantity to be Generated.
a. Each time the Order Date Calculation is run, the program calculates the date of item generation by converting the Due Date to a Shop Date. Then, it links to the Calendar file (CT140M) to see if it finds a matching record. If none are found, the converted Due Date is subtracted by DK to Stock Leadtime. The Shop Date is then converted to the Requisition Date, which is then linked to the Calendar file (CT140M) to find a matching record. If a matching record is not found, the program returns a message indicating that the date is not found.
b. Each time the Quantity to be Generated is executed, the program checks whether the Generation Date is smaller than the Horizon Date.
(1) If it is, the Quota Calculation program (PO285E) is called. Once executed, it returns the Calculated Quota. For each calculation processed, the program computes and generates the Affected Quantity and then updates the Requisition Detail file (PO180M3). To do this, the program initializes the Generated Quantity which has already been created and checks whether a Receipt Release exists after the Requisition Due Date.
(a) If a Release exists, the program retrieves the first Release Order Line after the Requisition Due Date. If this Release Order Line is retrieved for an order and date which already has a receipt, the Requisition will not be covered.
(b) If a Release does not exist, the program calculates the quantity to be processed. To do this, the Purchase Order Line file (PO180M2) is accessed to find the calculated Quota. (That number is multiplied by the highest percentage of quota entered during the Item/Vendor Relationship conversation. The vendor with the highest percent will be allocated first, until the first ten vendors have been taken into account. If the Order Release Quantity is less than the Calculated Quantity, then the order is over reserved. If the previous Order Release Quantity is over received, then the largest quantity will be allocated.) If that calculated quantity is greater than zero, then the Calculated Quantity is summed. After the aforementioned procedures have completed, the following files are updated: the Release Order Detail file (PO180M3), the Order Line file (PO180M2), the Order Header file (PO180M1), the Warehouse Balance file (CT140M), and the Printer Output file (PO285PF1). The program is reinitialized to process another record.
3. The report formatting is updated for the next record to be processed and the Requisition Master file (PO160M1) is updated.