MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Technical Library > Distribution > Order Processing > Programs > Automatic Order Release - Purpose > Automatic Order Release - Calculations

Automatic Order Release - Calculations

OP630E

A.   Housekeeping

1.   See the Common Processing Routines - Housekeeping section of this manual for a general discussion of this subroutine.  Processing specific to this program is described below.

2.   The following information is retrieved from the Reference file:

a.   System defaults (category 133).  This record is used to determine if the U.S. or free-form address format should be used.  It is also used to determine if the environment is single-currency or multi-currency.  For multi-currency environments, the currency level is determined (global, company, or location).

b.   VAT codes (category 308).

c.   Order type codes and descriptions (category 401).

d.   Hold codes (category 402).

e.   Order status codes and descriptions (category 403).

f.    Order Processing system defaults (category 413).  The order status information from this record is loaded into an array.

g.   Part type codes and descriptions (category 405).

h.   Home/export codes and descriptions (category 406).

i.    User/Company Authorization (category 409).  Valid company/warehouses for the user are retrieved and loaded into an array.

j.    Print codes (category 410).

k.   Backorder priority codes (category 411).

l.    Picker release codes (category 416).

m.  Order fill codes (category 417).

n.   Hold code authorization (category 418).

o.   Ship type codes and descriptions (450).

p.   System defaults (412).  This record is used to determine the decimal precision.

q.   Applications installed (012).

r.    Order in use codes (D01).

s.   Order life cycle credit check points (D38).

3.   Balance type information is retrieved from the Inventory Control record (ICCTL2) on the System Control file (CT100M).

4.   Warehouse information is retrieved from the Warehouse Description file (IC170M) and loaded into an array.

B.   Mainline

The program processes until all sales order header records are read.  In Backorder Release by Part mode, when submitted immediately, the program processes until all sales order line records for the request are processed;  when submitted in Batch, the program processes until all request records are processed.

Note:  When processing in Backorder Release by Part mode and the request was submitted in Batch, the Backorder Release by Part Request file will be read prior to processing the sales order header.  Once the request is read, a sales order line logical (either by promised ship date or backorder priority) will be read to process all the orders for the requested part.  If Backorder Release by Part was requested in immediate mode, the sales order line logical will be read to process all orders for the part passed to the program.  Once the sales order line logical is read, the sales order header will be processed.

1.   Process Sales Order Header.  The order is credit checked if it is credit held or if Reference File category D38 is set to credit check all orders.  Tests are performed to determine how to process the order.  If the program was submitted to process only EDI orders, the EDI flag (SHEDFL) is set to no.  If a new release can be created (the order is released or partially shipped and not fully reserved), a flag is set to perform the release.  If the order status is open and inventory can be reserved, a flag is set to attempt inventory reservation.  If the print option has been passed to the program, a flag is set to produce the Outstanding Order Report file.  If a release can be created, a child order header is formatted and added to the Sales Order Header file (OP100M1U).  The release will not be created if the program is called from the Manufacturing Receipt program (IC130E).

Note:    Credit checking is performed by the CRDCHK program if the credit check option is Yes (on Reference File category D38) and if the customer is not exempt from credit checking (CMCRTP = 0). 

2.   Process Sales Order Lines.  All the line records are read for each header record to be processed.  For each open line, the following processing is performed (if processing a Backorder Release by Part, the sales order line has already been read in RSOLNE):

a.   If the part type on the line is a Bundle Header record, bundle reservation calculations are performed.

b.   Auto order release audit trail fields are formatted.

c.   If processing Auto Order Release Request, check if the sales order line promised ship date range was specified.  If so, validate that the sales order line's promised ship date falls within the specified range.

d.   Availability checking is performed by the AVLCHK program. 

e.   New release lines are created if a flag was set on during header processing to create a new release.  Lines will only be put on the release if inventory can be reserved.  For each formatted child line, the following are performed:

(1)  Costing

(2)  Gross margin checking

(3)  Tax processing

(4)  Weight and volume calculations

(5)  Unit of measure conversions, if required

(6)  The sales order planning flag (SLPLFG) is set to no if the line will be sourced from a distribution warehouse and yes if it will be sourced from a manufacturing balance within a manufacturing warehouse.  If the line will be sourced from a distribution balance within a manufacturing warehouse, the flag is set based on the option defined for the manufacturing warehouse on the Plant/Warehouse Description file.

(7)  The child order line is written to the sales order line file.

(8)  The child order lines discount detail records are written to the Sales Order Discount Detail file.

(9)  The parent sales order line record is updated with the appropriate quantity values.

(10) The warehouse balance record is updated for the sourcing company/warehouse of the child line.

(11) The warehouse balance record is updated for the sourcing company/warehouse of the parent line.

(12) The Part Master file is updated if the net change flag was set on.

(13) Control totals are incremented.

(14) The sales order comment, audit trail, and transaction register records are written unless the program is called from the Manufacturing Receipt program (IC130E)..

f.    Configuration coded, lot assignable parts are processed as follows:

(1)  If the program is called from the Manufacturing Receipt program (IC130E), the multiple location record (IC130M) corresponding to the passed parameters is retrieved.

(2)  If the program is not called from IC130E, the lot assigned to the sales order line configuration code is retrieved from the Configuration Assignment Master file (EC170M).  This lot is used to retrieve appropriate multiple location records from the Multiple Location Logical (IC130L20).

(3)  Each multiple location record read is processed for availability.

(a)  The remaining available balance is calculated as the difference of the lot's balance and its reserved balance on the multiple location record.

(b)  If the remaining available balance is greater or equal to the remaining quantity it has reserved for the sales order line, the remaining quantity is reserved on the Multiple Location file (IC130M) and the Sales Order Lot/Line file (OP100M4).  Otherwise the available balance is reserved.

g.   The program attempts inventory reservation, if the reserve inventory flag was set on in header processing.  If inventory can be reserved to the line, the following occur:

(1)  The sales order line record is updated with the new reserved quantity.

(2)  The warehouse balance record is updated for the line.

(3)  The Part Master file is updated if the net change flag was set on.

(4)  Control totals are incremented.

h.   If the print reports option is selected, records are written to the Outstanding Orders and Backordered Parts Report files.

3.   After all lines have been read for the order, the header record is updated with the control totals accumulated at the lines.  Any logical locks placed on the order by automatic order release are removed.  If inventory has been reserved to the order, credit is checked again and a request is written to reserve at the stock location level if inventory is reserved at the stock location level.  If inventory is not reserved at the stock location level and the order is for immediate picker print, an immediate picker print request record is written.