MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Technical Library > Distribution > Purchasing > Programs > Multi-Line Receipt Maintenance - Purpose > Multi-Line Receipt Maintenance - Calculations

Multi-Line Receipt Maintenance - Calculations

PO270E

A.   Housekeeping

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

2.   A parameter list is set up for the fast path, help screen, and inquiry program parameters.

3.   Key lists are defined for each file retrieved by the program.

4.   Workfields are defined and program constants are initialized.

5.   The following records are retrieved from the Reference file (REFERP):

a.   The date format record (category 049) is retrieved.  If this record is not found, the date format defaults to.

b.   The default company/warehouse is retrieved from the workstation assignment record (category 428).  This company/warehouse is validated against the array of authorized company/warehouses for the user.

c.   The decimal field precision record (category 446) is retrieved.

d.   All company/warehouses to which the user is authorized are retrieved from the user company/warehouse authorization record (category 409) and loaded into an array.  If no records are found for the user, a flag is set authorizing the user to all company/warehouses.

e.   The following categories are retrieved and stored in arrays for access during processing:

·      Purchase order document release codes (category 484)

·      Approval status codes (category 499)

·      Quantity control status codes (category 466)

·      Quality control status codes (category 467)

f.    The Purchasing application system defaults 1 record (category 491) is retrieved.  The default purchase order close flag and the purchase order receipt number assignment method are saved to determine whether the receipt number on the Function Select screen must be entered or will be system assigned.

g.   The Purchasing application system defaults 2 record (category 492) is retrieved.  The default ID tag release code is saved. 

h.   The Assign Lots option is retrieved from Reference File category Y34, Lot System Defaults.  If the value of the option is Y, then lots may be assigned automatically using the number from the Next Available Lot Number option.  This option is also on Reference File category Y34.

6.   The following records are retrieved from the System Control file (CT100M):

a.   The manufacturing company and warehouse are retrieved from the Design Engineering control record (DECTL1).

b.   The lot option and the purchase order receipt pending flag are retrieved from the first Inventory Control control record (ICCTL1).  If the lot option equals Y, a control environment is in effect.

c.   The valid balance types are retrieved from the second Inventory Control control record (ICCTL2).

7.   All valid company/warehouse combinations are retrieved from the Warehouse Description file (IC170M) and stored in an array.  The default company/ warehouse retrieved in step 5.b. above is validated against this array.

B.   Mainline

Control is passed among the following three screens. 

1.   Multi-line Receipt Function Select (PO270S01)

The Function Select screen allows the user to choose the maintenance function to be performed.  Two maintenance options may be chosen from the screen:  to create a purchase order receipt transaction or to modify an existing purchase order receipt transaction.  The following processing is performed:

a.   The Function Select screen is formatted and displayed.

b.   Using F18 - Order Retrieval, the user may call the Purchase Order Retrieval program (PO920E) to select a valid purchase order number.

c.   The Function Select screen is validated.

d.   The transaction is processed according to the maintenance mode.

(1)  For an add transaction, the Purchase Order Header file (PO180M) and Purchase Order Receipt Header file (PO210M1) are locked.  A minimal amount of information from the purchase order header record is used to create a new receipt header record to reserve the receipt number and prevent an intervening update.  The Purchase Order Receipt Header file is updated with a new record.  If automatic receipt number assignment is in effect, the next available receipt number (category 496) is updated on the Reference file (REFERPU).

The logical Purchase Order Line file (PO180ML7) is accessed; the multi-line detail subfile is loaded with all open purchase order lines for the current purchase order number.

(2)  For change transactions in which only the receipt number was entered, the Purchase Order Header file (PO180M1) and the Purchase Order Receipt Header file (PO210M1) are logically locked.

The Purchase Order Receipt Line file (PO210M2) is accessed; all lines for the current receipt number are loaded into the multi-line detail subfile.

e.   When the ENTER key is pressed, and no errors have occurred, the multi-line detail screen is displayed.

2.   Multi-line Detail Screen (PO270S02)

The detail screen allows the entry or modification of data pertaining to the entire receipt.  It allows the addition and modification of receipt line records and the display of purchase order line information.  The following processing is performed:

a.   For an add transaction, header information is loaded using the system date as a default for the receipt date and the transaction date.  If the order type is direct ship, the ID tags release code is not displayed; for a non-direct ship order, the ID tags release code defaults to the value retrieved from the Purchasing system defaults record on the Reference file.

b.   The detail subfile is initialized.

(1)  For a change transaction:

(a)  Current receipt data is loaded from the Purchase Order Receipt Line file (PO210M2).

(b)  If a shortage condition is detected, a flag is set to display a warning to the user.  Shortage conditions are determined as follows:

(i)   The Warehouse Balance File balance type quantities are summed as follows to give the On-Hand Quantity: 

      For a manufacturing warehouse, if the Order Planning flag on the balance type is Y, the quantity is added to the total. 

      For a manufacturing warehouse, if any balance types are available for both planning and distribution (both Order Planning Flag and Distribution Flag = Y on the balance type), and sales orders are not considered for planning (the Sales Order Planning Flag on the Warehouse Description file is N), then the inventory quantity reserved for customer orders is subtracted from the total. 

      For a distribution warehouse, if the Distribution flag on the balance type is Y, the quantity is added to the total.

(ii)   For non-direct ship purchase orders:

      If the company/warehouse is the manufacturing company/warehouse, the Sales Order Planning Flag is No, and the On-Hand Quantity (WKHAND) + Allocated Quantity - JIT (WBFRAQ) + Allocated Quantity - Synchro (WBSIAQ) is less than the Allocated Quantity - Manufacturing (WBAQMF), the Shortage Flag is set to Y.

      If the company/warehouse is the manufacturing company/warehouse, the Sales Order Planning Flag is Yes, and the On-Hand Quantity (WKHAND) is less than the Allocated Quantity - Manufacturing + Allocated Quantity - JIT (WBFRAQ) + Allocated Quantity - Synchro (WBSIAQ) plus the Reserved Quantity (WBRSOQ) plus the Backordered Quantity (WBBOSQ), the Shortage Flag is set to Y.

      If the company/warehouse is a distribution company/warehouse and the On-Hand Quantity (WKHAND) is less than the sum of the Reserved Sales Order Quantity (WBRSOQ) and Backordered Sales Order Quantity (WBBOSQ), the Shortage Flag is set to Y.

(iii)  For direct ship purchase orders, if the On-Order Quantity - Direct Ship Purchase Order (WBQDSP) is less than the On-Order Quantity - Direct Ship Sales Order (WBQDSS), the Shortage Flag is set to Y.

(c)  Data is retrieved from the Purchase Order Line file (PO180M2).  The unreceived quantity is calculated.  If it is less than or equal to zero, the subfile record is high-lighted and a message is displayed to the user that there is no quantity left to receive on the line.

(d)  If the user enters a quantity in the Received Quantity field that is greater than the amount in the Balance Due field, a warning message will be displayed.  The following calculation is used to determine the total received quantity.

TOTAL RECEIVED QUANTITY

=

QUANTITY PER SCREEN

plus

RECEIVED QUANTITY

minus

SKU
(PO180M2)

(2)  For an add transaction, data is retrieved from the logical Purchase Order Line file (PO180ML7).  The unreceived quantity is calculated.  If it is less than or equal to zero, the subfile record is highlighted and a message is displayed to the user that there is no more quantity left to receive on the line.  If the user enters a quantity in the Received Quantity field that is greater than the amount in the Balance Due field, a warning message will be displayed.  The following calculation is used to determine the total received quantity.

TOTAL RECEIVED QUANTITY

=

QUANTITY PER SCREEN

plus

RECEIVED QUANTITY

minus

SKU (PO180M2)

a.   When the user accesses this screen, the primary stock location value defaults from the Part Master File to the Stock Location field for each receipt line that is formatted in the multi-line subfile.  The user may change the defaulted primary stock location.  If there is no primary stock location for the part, the Stock Location field is formatted with blanks. 

b.   Command keys are available to display the different stock locations of a part.  F10 - Function Select issues a message to the Purchasing asynchronous message queue and returns control to the Function Select screen.  F11 - Add a Line allows the association of an additional receipt line to a purchase order line.  F12 - Display Comment is used to create comments for header comment or detail receipt line comment information.  When no receipt line record is selected, header comment information will be created.  F18 - Multiple Purchase Order is used to call the Multiple Purchase Order Window (PORCTWIN).  For an add transaction the user can enter multiple purchase order the receipt should be used for.  For change transaction the window  displays all purchase orders for this receipt. 

c.   The detail screen is validated.

d.   Records to be updated are physically locked.

(1)  The Purchase Order Header file (PO210M1) is updated with new header information.  An audit trail record is formatted and written to the Purchase Order Audit Trail file (PO500AL).

(2)  The Purchase Order Receipt Line file (PO210M2) is updated.

(3)  The Purchase Order Receipt Parcel file (PO210M3) is updated.  One purchase order receipt line record has one purchase order parcel record.

(4)  An audit trail record is written to the Purchase Order Audit Trail file (PO500AL).

(5)  The Purchase Order Header file is updated with the new number of receipt lines (RHNOLN).

e.   When the ENTER key is pressed, a message is displayed to the user that the receipt transaction has been processed.

f.    The following conditions determine which screen is displayed next:

Conditions

 

Screen Displayed

F10 - Select Function is pressed

Function Select screen (PO270S01)

F12 - Display Comments is pressed

Comment screen (PO270S03)

3.   Multi-line Receipt Comment Screen (PO270S03)

The comment screen allows the addition or maintenance of comment records associated with a receipt header or a receipt line.  Up to 99 comment records can be entered for a header record.  In addition, up to 99 comment records can be entered for each line.

Each comment line has an associated print code, which determines if the comment line should be printed and where.  To delete a comment line, both the print code and the comment text must be blanked out.  The following processing is performed:

a.   The screen is initialized and displayed.

b.   The user's input is validated.

c.   If the fields are valid, the comments are written to the Purchase Order Receipt Comment file (PO210M4) and an audit trail record is formatted and written to the Purchase Order Audit Trail file (PO500AL).

d.   The following conditions determine which screen will be displayed next:

Conditions

 

Screen Displayed

F4 - Display Detail is pressed

Multi-line Detail screen (PO270S02)

F10 - Select Function is pressed

Function Select screen (PO270S01)

 

PO270E Program Menu