Documentation >
MAC-PAC Technical Library >
Manufacturing >
Inventory Control >
Programs >
Batch Forecast Shipments - Purpose >
Batch Forecast Shipments - Calculations
Batch Forecast Shipments - Calculations
IC140E
A. Housekeeping
1. Common Processing Routines are performed. Once finished, processing specific to this program is done as described below.
2. Key lists needed by the program are defined. Work fields and constants are defined and initialized.
3. The following information is retrieved from the Reference file (REFERP).
a. The operating system' s file status codes (category 015) are retrieved. If the file access codes are not found, the program terminates.
b. The date format (category 049) is retrieved. If this record is not found, a message is sent to the system operator, the date format defaults to MMDDYY, and processing continues.
c. The quantity field sizes (category 446) are retrieved. If they are not found, the program terminates.
d. The product costing install flag is retrieved from category 012. This field is used in calculations of the item unit cost.
e. The Future Three Interface Defaults (category D26) are retrieved. If they are not found, the program terminates.
f. The currency level is retrieved from the System Defaults category (133). An error message is written if this level is at location level, and the company/location changes are within the same shipper number.
g. The order type codes (category 401) are retrieved. If they are found, the order types are formatted and loaded into the order types array (OTA). If category 401 is not found, the program terminates.
h. The order status codes and descriptions (category 403) are retrieved. If they are found, the order status contents are formatted and loaded into the status codes array (SCA). If category 403 is not found, the program terminates.
i. Valid company/warehouse combinations are loaded into an array from category 409. If no specific company/warehouse records are found for the user, the user is allowed access to every company/warehouse combination.
j. The update part statistics flag is retrieved (category 432), using the adjustment code retrieved from the Future Three Interface Defaults (category 026).
k. The last sales period posted (category 435) and the calendar/period flag (category 407) are used to help determine the accounting period.
4. System Control file data is retrieved.
a. The lot option flag is retrieved from the Inventory Control control record one (ICCTL1) and saved. If the record is not found, the program terminates.
b. The product balance type information is retrieved from the System Control file (ICCTL2). If the record is not found, the program terminates.
c. The company name is retrieved from the COMNAM record in the System Control file. If not found, the company name is formatted with blanks.
5. All valid company/warehouse combinations are loaded into an array (CWA) from the Warehouse Description file (IC170M). If no records are found in the Warehouse Description file, the program terminates.
B. Mainline
1. A transaction is retrieved from the Forecast Shipments Transaction file (IC140APl). If the record is not found, an exception report is written for no transactions. Only transactions with a blank error field (FSERR) (indicating not yet processed) are retrieved for processing.
2. All fields are validated. Validation rules are explained below. If fields are invalid, error messages are written to the error report.
a. Part Number
If blank or all 9s, an error message is printed and the valid flag is set to No. Otherwise, the part number is looked up on the Part Master file. If not found, the record is invalid. If found, but part is inactive, planned, reference, nonstandard, configured, bundled, nonstock, or lot assignable, record is invalid for shipment.
b. Company Number
If blank or all 9s, record is invalid.
c. Warehouse Number
If blank or all 9s, record is invalid.
d. Customer
If all 9s or blanks, record is invalid.
e. Shipping Date
If blank or all 9s, date is invalid.
f. Quantity Shipped
If blank, quantity is invalid.
The following validations only occur if no errors have appeared so far.
g. Lot Number
If the lot option (LOTOPT) is 'Yes' and the part is lot controlled (as determined from the Part Master file), lot number must not be blank or all 9s. The lot number is checked in the Lot Control file (IC150M). If not found, lot number is invalid. If found, but lot status is closed or lot FIFO date is blank, lot number is invalid.
h. Company/Warehouse Combination
The combination must appear on the Warehouse Description file. Inventory updates must be allowed for the warehouse.
i. Company/Warehouse Authority
If a valid combination was found, the user must have authority to the combination.
j. Company/Warehouse Costing Method
If a valid combination was found, the Warehouse Description file is checked for standard or moving average costing. The costing method must be one of those two.
k. Warehouse Balance
A warehouse balance record must exist for the part/company/warehouse. If a record exists, it must be active.
l. Stock Location
The stocking location must be a valid location for the company/warehouse combination on the Location Validation file (DE140M).
3. If all the fields are valid, the inventory balances are adjusted to reflect the shipment. The Demand Forecast file (MS150M) is checked for a record corresponding to the shipment transaction record. If a record is not found, an exception message is written. However, since a shipment was made, inventory is still adjusted by the transaction amount to maintain accurate inventories.
4. If the transaction record does not correspond to a multiple location record, a new record is formatted.
5. The unit cost is calculated by adding standard material, labor, and overhead, if the costing method is standard. If the costing method is moving average, the moving average cost is retrieved from the Warehouse Balance file and that becomes the unit cost.
6. The quantity shipped for this transaction is added to the previous quantity shipped to give a total quantity shipped. This field is updated on the Projected Demand file (MS150M).
7. The new inventory balances are calculated. For the Multiple Location and Warehouse Balance files, the shipped quantity (FSQTY) is subtracted from a balance type identified on Reference File category D26. If the balance fields are driven negative, a message is written to the Master Scheduling Error file (MS505AP).
8. Other master file fields are then formatted.
a. On the Multiple Location file, the Date of Last Transaction field is formatted with the current system date. The activity since last count is incremented with the issue quantity. If a new record is being added to the file, the remaining fields are formatted with blanks and zeros.
b. On the Warehouse Balance file, the year-to-date activity is incremented with the shipped quantity. If overflow occurs, a critical message is written to the Master Scheduling Error file. The Date of Last Shipment is updated with the ship date from the Transaction file. The date of last transaction and last maintenance date are updated with the current system date, and the user ID is used to format the Last Maintenance Operator field. The cost of sales, shipped sales amount, shipped order lines, and shipped order quantity fields, depending on accounting period, are updated if the update part statistic flag (category 432) is Yes. In a multi-currency environment, amounts are converted from the customer's base currency (as defined on the Customer Master file) to the base currency for the company/location (as defined on Reference File category 002). The exchange rate is retrieved from the Currency Master file (CF240M).
c. On the Part Master file, the net change processing flag is set to 1.
9. The master files are then updated.
10. If the transaction was successfully processed, the Inventory Control Audit Trail, Inventory Transaction Register, Master Scheduling Audit Trail, and Master Scheduling Transaction Register are written.
11. If the transaction was successfully processed, the error flag field (FSERR) on the transaction file is updated with a value of 1 indicating successful processing. If the transaction was not successfully processed, FSERR is updated with a value of 9, indicating unsuccessful processing.
12. For each successfully processed transaction record, the unit cost field (FSUNCT) is updated with the value of the unit cost calculated during processing. This value will be used later by the Batch Billing program.
13. The deletion of transaction records from the Transaction file (IC140APl) is handled by the Batch Billing program (IC110E).