MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Technical Library > Distribution > Order Processing > Programs > Shipping/Billing Inventory Update - Purpose > Shipping/Billing Inventory Update - Calculations

Shipping/Billing Inventory Update - Calculations

OP125E

A.   Housekeeping

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

2.   The Company Name and Balances Available for Distribution are retrieved from the System Control file (CT100M).

3.   Arrays and fields are initialized from the Reference file (REFERP).

4.   Warehouse description information is retrieved from the Warehouse Description file (IC170M) and stored in arrays.

5.   The country codes are retrieved from Reference category 007.

B.   Mainline

1.   Parameters for one shipping/billing transaction are passed from the Shipping/Billing monitor program.

2.   For each transaction , the Open Order Shipping and Billing Header Workfile (OP120AP1) is read with a key of , Order Number, Release Number, Shipment Number, Company, and Warehouse.

3.   Shipping and billing header processing is performed for each workfile header record retrieved in step 2.

a.   The current period/next period posting flag is set based on a comparison of the document date and the current period end date on the sales calendar.  This flag is used to condition which statistics are updated on the Warehouse Balance file (IC140M) and the Customer Name and Address file (ARADDRP).

b.   If the consolidate invoice flag on OP120AP1 is no, next invoice number or cash sales invoice number is retrieved from the Reference file (REFERPU) if no processing has occurred for this order shipment.  Otherwise, if the flag is yes, the sales order number is used as a temporary invoice number until the actual invoice is created by the invoice consolidation program.

c.   If processing has already been started for this order shipment, the current period/next period posting flag and document number values are already stored on the workfile header.

      This situation could occur if a system failure occurred while a shipped order was being processed.  In order to facilitate a recovery/restart situation and to avoid duplicate updates, a record posted flag is updated on each workfile record after processing is complete for the record.

d.   Shipping and billing line (if not consolidating invoices) processing is performed for each line workfile record associated with the header workfile record retrieved in step 2.

(1)  The Shipping/Billing Line Workfile (OP120AP2) is read sequentially using a key of Prompt Company, Prompt Warehouse, Order Number, Release Number, and Shipment Number.

(2)  For each line workfile record retrieved, the related sales order line record is retrieved.  The related Shipment picker line is also retrieved.

(3)  Part Master File information is retrieved for the line shipped.

(4)  If shipping activity has occurred for the line and the line has not yet been posted, line location processing is performed for each line location workfile record associated with the line.

(a)  The Shipping/Billing Line Location Workfile (OP120AP4) is read sequentially using a key of Prompt Company, Prompt Warehouse, Order Number, Release Number, and Line Number.

(b)  For each line location workfile record retrieved, line location updating is performed if the line location record has not been posted.  This processing performs updates to the Part Master file (DE100MU), Warehouse Balance file (IC140M), and Multiple Location file (IC130M), and writes records to the Sales Order Shipment/Return Audit Trail file (IC190BP), Shipment/Return Transaction Register (IC190CP), and Sales History file (OP120M). Records are written to the IC Transaction Error file (IC505AP) for any warning errors detected during entry or posting.  These updates reflect the effect of detail shipping activity against a line on the company/warehouse and location/lot on-hand balances.

(5)  Sales order line updates are determined based on the total shipping activity for the line and any line maintenance that was performed.

(6)  The updates to the Warehouse Balance file are determined based on the total shipping activity for the line.  These updates reflect the effect of total shipping activity against a line on the summary order quantities (reserved, backordered, unreserved, allocated) and sales statistics at the company/warehouse level.

(7)  The Shipping/Billing Comment Workfile is read sequentially using a key of Prompt Company, Prompt Warehouse, Order Number, Release Number, and Line Number.  All line comments that have not been posted are processed; updates are made to the Sales Order Line file (OP100M2) and the Open Item Comment file (ARCMTSP).  Only comments with the appropriate Print Code are written to the Open Item Comment file.  Audit trail (IC180BP3) and transaction register (IC180CP3) records are also written.

(8)  Line update processing is performed:

(a)  If the part net change flag is on, the Part Master file (DE100MU) is retrieved for update.

(b)  If the consolidated invoicing flag is no, the Open Item Distribution File (ARDISTP) record is formatted and written.  In addition, the Open Item Discount Detail records (ARDSCP) are formatted and written.  If the flag is yes, the Pending Invoice Distribution file (ARPNDDP) is formatted and written.  Also, the Pending Open Item Discount Detail records (ARPNDSP) are formatted and written.

(c)  If the total on-hand balance on the Warehouse Balance File (IC140M) record is zero and inventory value is not zero, inventory value is set to zero on the Warehouse Balance File record.  Adjustment records are written to the audit trail (IC190BP) and transaction register (IC190CP) files.

(d)  If the part uses a configuration code and the configuration code record does not exist in the Configuration Code file (EC140M), the record is added

(e)  The Invoice Lot Master File (ARLOTP) records are written for lot-controlled items.

(f)   The sales order line record is updated.

(g)  The Part Master File record is updated if the net change flag is on.  The net change flag is set if the order line was to be filled from inventory that is planned by the Master Scheduling and Requirements Planning modules (Sales Order Planning Flag = Y).  Specific conditions that cause this update are:

(i)   Overshipment from planned inventory.

(ii)   Shipment from  non-planned inventory when planned inventory  was originally specified.

(iii)  Addition of a line sourced from the manufacturing company/warehouse using planned inventory.

(h)  If the line has been shipped, a sales accounting transaction record is written to the Accounting Transaction file (AR510AP).

(i)   If a VAT environment exists and the consolidated invoicing flag is no, a VAT accounting transaction record is written to the Accounting Transaction file.  If the customer is subject to VAT surcharge, then a VAT surcharge accounting transaction record will be written.

(j)   Sales order line records are written to the audit trail (IC180BP2) and transaction register (IC180CP2) files.

(k)  If the order being shipped is a backorder or blanket release, parent sales order line, warehouse balance, and parent sales order header updates are made.  These updates are performed to bring the status of the parent order line and header into agreement with the status of the release (child) line just shipped.  Parent order line updates include Subsequent Release Quantity, Subsequent Ship Quantity, Unreleased/Backorder Quantity, and Line Status.  Parent order header updates involve the order status.

(l)   The line workfile record posted flag is set to yes, and the record is updated.

(m) The line status and actual shipped quantity are updated on the Shipment Picker Line file OP510M2.

(n)  A commitment unit is made.

(9)  If any line is not shipped complete and the shipment type is direct, our immediate backorder release is created.  If partially shipped, lines are identified the flag for direct distribution is set to yes.  If warehouse shipped lines are identified the BOL req flag is formatted to yes.  If shipment type is direct, the BOL number on sales order is formatted with number from the line workfile (OP690BP).  The BOL Trigger file is written only when the BOL req flag is yes and immediate print is requested.  The trigger record is written to the OP310HP only if release code is normal.  If the release code is not hold the (OP690BP2) BOL shipment transaction print file is written. 

e.   Freight processing is performed if the freight amount is greater than zero.  See the Common Processing Routines - Process Freight Amount section of this manual for a discussion of this processing.  Records are added to the Open Item Distribution file or Pending Invoice Distribution file (based on the Consolidated Invoicing flag), the Sales History file, and Accounting Transaction file.  The Warehouse Balance file is updated based on the freight amount.

f.    State, county, and city tax processing is performed.  Records are added to the Open Item Distribution file or Pending Invoice Distribution file, and Accounting Transaction file based on the values of the Amount Subject to Tax and the Tax Rates.  This processing is not performed in a VAT environment.

g.   Header level comments are processed.  Updates are performed to the Sales Order Comment file.  Records are added to the Open Item Comment file for all comment workfile records for the order with the appropriate Print Code.

h.   Header update processing is performed:

(1)  Update fields are formatted for the sales order header record.

(2)  The Customer Master File (ARCUSTP) record is retrieved and updates are made.

(3)  The Customer Name and Address File (ARADDRP) record is retrieved and updates are made.

(4)  Accounts receivable/accrued receivable or cash and cash discount accounting transaction records are written to the Accounting Transactions file (AR510AP) based on the document type.

(5)  If the consolidated invoicing flag is no, a record is written to the Activity Log file (ARLOGP).

(6)  If the consolidated invoicing flag is no, the Open Item Header file (AROPENP) is formatted and written.  Otherwise, if the flag is yes, the Pending Invoice Header file (ARPNDOP) is formatted and written.

(7)  Sales order header records are written to the audit trail (IC180BP1) and transaction register (IC180CP1) files.

(8)  The shipping/billing header workfile record is updated to indicate that processing is complete.

(9)  The shipment status, actual ship date, actual shipped volume, actual stripped weight, document type, and document number are updated on the Order Shipment Master file.

(10) The order is unlocked.  (The parent order is also unlocked if a release is being shipped.)

(11) A commitment unit is made.

i.    Bundle processing is performed.  All lines are read, and if a bundle is encountered, the bundle line status is updated based on the lines, and the bundle quantity fields are updated based on the first (A) component.

j.    A message is sent to the workstation that entered the shipping/billing information for the order to indicate the successful (or unsuccessful) completion of processing.  If the workstation is not found, the message is sent to the system operator message queue (QSYSOPR).

OP125E Program Menu