Documentation >
MAC-PAC Technical Library >
Distribution >
Order Processing >
Programs >
Sales Order Availability Checking - Purpose >
Sales Order Availability Checking - Calculations
Sales Order Availability Checking - Calculations
AVLCHK
A. Initialization
1. The following fields are calculated in the routine and are cleared at the beginning of the subroutine:
Change in Reserved Sales Order (S.O.) Quantity
Change in Backorder S.O. Quantity
Change in Unreserved S.O. Quantity
Change in On Order Quantity (OOQ)—Direct S.O.
Change in Backorder S.O. Quantity (parent warehouse)
Change in Unreserved S.O. Quantity (parent warehouse)
Change in Order Quantity
Change in Original Release Quantity
Change in Unreleased/Backorder Quantity
Change in Subsequent Release Quantity (parent line)
Change in Unreleased/Backorder Quantity (parent line)
New Unreleased/Backorder Quantity
On—Hand Quantity — Distribution
Old Available Quantity
New Available Quantity
New Required Quantity (in SKU)
Change in Allocated Quantity
2. The following quantities (that were passed to the subroutine) are converted from order units to stockkeeping units (SKU):
New Order Quantity
New Released Quantity
Old Order Quantity
Old Released Quantity
Old Unreleased/Backorder Quantity
Note: Units of measure are very important in performing availability checking. Since the availability routine performs all calculations in sku, if the order unit of measure is different from sku, small rounding errors may result in the updating of the Warehouse Balance file. To correct these rounding errors, the Order Processing Audit program should be run.
B. Closed Line Processing
1. If the status of the line has been changed to closed, the subroutine backs out the appropriate quantities from the warehouse balance record and sales order line record. No closed line logic is performed for reference parts or standing orders.
2. If the order is a blanket order, the Shipment Type is checked.
a. If the Shipment Type is warehouse, the Old Unreleased/Backorder Quantity is subtracted from the Change in Unreserved S.O. Quantity.
b. If the Shipment Type is direct, the Old Unreleased/Backorder Quantity is subtracted from the Change in OOQ-Direct S.O.
3. If the order is not a blanket order and the Shipment Type is not direct:
a. If the reserve inventory flag is yes:
(1) If the Relief Code indicates that the inventory will come from distribution balances, the Old Released Quantity is subtracted from the Change in Reserved S.O. Quantity.
(2) If the Relief Code indicates that the inventory will come from manufacturing balances, the Old Released Quantity and the Old Unreleased/Backorder Quantity are subtracted from the Change in Allocated Quantity.
(3) The Old Unreleased/Backorder Quantity is subtracted from the Change in Backorder S.O. Quantity.
b. If the reserve inventory flag is no, the Old Order Quantity is subtracted from the Change in Unreserved S.O. Quantity.
c. If it is a backorder release order and the Relief Code is distribution balance, the Change in Backorder S.O. Quantity (parent warehouse) is set to the Old Order Quantity.
d. If it is a blanket release order, the Change in the Unreserved S.O. Quantity (parent warehouse) is set to the Old Order Quantity.
4. If it is a regular order and the Shipment Type is direct, the Change in OOQ-Direct S.O. is set to the sum of the Shipped Quantity Original plus Shipped Quantity Subsequent, less the Old Order Quantity.
5. If it is a blanket or backorder release order:
a. The Old Order Quantity is subtracted from the Change in Subsequent Release Quantity (parent line).
b. The Change in Unreleased/Backorder Quantity (parent line) is set to the Old Order Quantity.
c. All of the line availability exception flags are turned off.
C. Standard Quantity Changes
1. The standard quantity changes are calculated.
a. The Change in Order Quantity is the New Order Quantity less the Old Order Quantity.
b. The Change in Original Release Quantity is the New Released Quantity less the Old Released Quantity.
c. The Change in Unreleased/Backorder Quantity is the Change in Order Quantity less the Change in Original Release Quantity.
2. The New Unreleased/Backorder Quantity is the sum of the Old Unreleased/Backorder Quantity and the Change in Unreleased/Backorder Quantity.
3. The New Required Quantity (in SKU) is set equal to the New Order Quantity (in SKU).
D. Manufacturing Balances
1. If the Relief Code indicates that the inventory will be coming from manufacturing balances, and if it is a blanket order:
a. The Change in Original Release Quantity is set to zero.
b. The Change in Unreleased/Backorder Quantity is set to the Change in Order Quantity.
c. The New Released Quantity is set to zero.
d. The New Unreleased/Backorder Quantity is the sum of the Old Unreleased/ Backorder Quantity and the Change in Unreleased/Backorder Quantity.
e. The Change in Unreserved S. O. Quantity is set to the Change in Order Quantity.
2. If the Relief Code indicates that the inventory will be coming from manufacturing balances, and if it is not a blanket order:
a. If the reserve inventory flag is set to no:
(1) The Change in Original Release Quantity is set to zero.
(2) The New Released Quantity is set to zero.
(3) The Change in Unreleased/Backorder Quantity is set to the Change in Order Quantity.
(4) The New Unreleased/Backorder Quantity is the sum of the Old Unreleased/Backorder Quantity and the Change in Unreleased/Backorder Quantity.
(5) The Change in Unreserved S.O. Quantity is set to the Change in Order Quantity.
(6) If it is a blanket or backorder release:
(a) The Change in Subsequent Release Quantity is set to the Change in Order Quantity.
(b) The Change in Order Quantity is subtracted from the Change in Unreleased/Backorder Quantity.
b. If the reserve inventory flag is yes:
(1) If the inventory was not previously reserved:
(a) The Old Order Quantity is subtracted from the Change in Unreserved S.O. Quantity.
(b) The Change in Allocated Quantity is set to the New Order Quantity.
(2) If the inventory was previously reserved:
(a) If it is a blanket or backorder release:
(i) The Change in Subsequent Release Quantity (parent line) is set to the Change in Order Quantity.
(ii) The Change in Order Quantity is subtracted from the Change in Unreleased/Backorder Quantity (parent line).
(b) The Change in Allocated Quantity is set to the Change in Order Quantity.
E. Master File Quantity Adjustments
1. If the order is a standing order:
a. The Change in Original Release Quantity is set to zero.
b. The New Released Quantity is set to zero.
c. The Change in Original Release Quantity is set to the Change in Order Quantity.
d. The New Unreleased/Backorder Quantity is set to the New Order Quantity.
2. If it is a blanket order:
a. The Change in Original Release Quantity is set to zero.
b. The New Released Quantity is set to zero.
c. The Change in Original Release Quantity is set to the Change in Order Quantity.
d. The New Unreleased/Backorder Quantity is the sum of the Old Unreleased/Backorder Quantity and the Change in Unreleased/Backorder Quantity.
e. If the Shipment Type is warehouse, the Change in Unreserved S.O. Quantity is set to the Change in Order Quantity.
f. If the Shipment Type is direct, the Change in OOQ-Direct S.O. is set to the Change in Order Quantity.
3. If it is not a standing or blanket order and the Shipment Type is direct:
a. If it is a regular order, the Change in OOQ-Direct S.O. is set to the Change in Order Quantity.
b. If it is a blanket release or backorder release:
(1) The Change in Subsequent Release Quantity is set to the Change in Order Quantity.
(2) The Change in Order Quantity is subtracted from the Change in Unreleased/Backorder Quantity.
c. The On-Hand Quantity - Distribution is set to zero for display on the line detail screen.
d. The New Available Quantity is set to the OOQ-Direct Ship P.O. less the Old OOQ-Direct Ship S.O., less the Change in OOQ-Direct S.O. This amount is displayed on the line detail screen.
4. If it is not a standing or blanket order and the reserve inventory flag is no:
a. The Change in Original Release Quantity is set to zero.
b. The New Released Quantity is set to zero.
c. The Change in Unreleased/Backorder Quantity is set to the Change in Order Quantity.
d. The New Unreleased/Backorder Quantity is the sum of the Old Unreleased/ Backorder Quantity and the Change in Unreleased/Backorder Quantity.
e. The Change in Unreserved S.O. Quantity is set to the Change in Order Quantity.
f. If it is a backorder release:
(1) The Change in Subsequent Release Quantity (parent line) is set to the Change in Order Quantity.
(2) The Change in Order Quantity is subtracted from the Change in Unreleased/Backorder Quantity.
(3) The Change in Order Quantity is also subtracted from the Change in Backorder S.O. Quantity (parent warehouse).
g. If it is a blanket release:
(1) The Change in Subsequent Release Quantity (parent line) is set to the Change in Order Quantity.
(2) The Change in Order Quantity is subtracted from the Change in Unreleased/Backorder Quantity.
(3) The Change in Order Quantity is also subtracted from the Change in Unreserved S.O. Quantity (parent warehouse).
5. If it is not a standing or blanket order and the reserve inventory flag is yes:
a. The On-Hand Quantity - Distribution is the sum of all balance types available for distribution and for display on the line detail screen.
b. The Old Available Quantity is the On-Hand Quantity - Distribution less the Reserved S.O. Quantity from the warehouse balance record.
c. The New Available Quantity is the Old Available Quantity less the Old Backorder S.O. Quantity, less the Change in Original Release Quantity, and less the Change in Backorder Quantity. This amount is displayed on the line detail screen.
d. If the New Available Quantity is less than zero and the over reservation allowed flag is no:
(1) If the Old Available Quantity is less than zero, and if the New Released Quantity is greater than the Old Released Quantity, the available quantities are reset:
(a) The Change in Original Release Quantity is set to zero.
(b) The Change in Unreleased/Backorder Quantity is set to the Change in Order Quantity.
(c) The New Available Quantity is set to the Old Available Quantity.
(d) The New Released Quantity is set to the Old Released Quantity.
(e) The New Unreleased/Backorder Quantity is the sum of the Old Unreleased/Backorder Quantity and the Change in Unreleased/ Backorder Quantity.
(2) If the Old Available Quantity is not less than zero:
(a) The Change in Original Release Quantity is set to the Old Available Quantity.
(b) The Change in Unreleased/Backorder Quantity is the Change in Order Quantity less the Change in Original Release Quantity.
(c) The New Available Quantity is set to zero.
(d) The New Released Quantity is the sum of the Old Released Quantity and the Change in Original Released Quantity.
(e) The New Unreleased/Backorder Quantity is the sum of the Old Unreleased/Backorder Quantity and the Change in Unreleased/ Backorder Quantity.
e. The Change in Reserved S.O. Quantity is set to the Change in Original Release Quantity.
f. The Change in Backorder S.O. Quantity is set to the Change in Unreleased/ Backorder Quantity.
g. If the previous reserve inventory flag was no, the Old Order Quantity is subtracted from the Change in Unreserved S.O. Quantity.
h. If the previous reserve inventory flag was yes:
(1) If it is a backorder release, the Change in Order Quantity is subtracted from the Change in Backorder S.O. Quantity (parent warehouse).
(2) If it is a blanket release, the Change in Order Quantity is subtracted from the Change in Unreserved S.O. Quantity (parent warehouse).
(3) For both backorder releases and blanket releases:
(a) The Change in Subsequent Release Quantity (parent line) is set to the Change in Order Quantity.
(b) The Order Quantity is subtracted from the Change in Unreleased/Backorder Quantity (parent line).
F. Exception Processing
1. The backorder exception flag is set to yes and a warning message is written if all five conditions are met:
The New Unreleased/Backorder Quantity is greater than zero.
The reserve inventory flag is yes.
The Change in Unreleased/Backorder Quantity is greater than zero.
The backorder exception flag is no.
The Shipment Type is warehouse.
2. The direct ship exception flag is set to yes and a warning message is written if all four conditions are met:
The Shipment Type is direct.
The order is not a standing order.
The Change in Order Quantity is not zero.
The direct ship exception flag is no.
3. The negative availability exception flag is set to yes and a warning message is written if all four conditions are met:
The New Available Quantity is less than zero.
The Old Available Quantity was not less than zero.
The Shipment Type is warehouse.
The negative availability exception flag is no.
4. The negative availability exception flag is set to no if all three conditions are met:
The New Available Quantity is not less than zero.
The reserve inventory flag is yes.
The Shipment Type is warehouse.
5. The backorder exception flag is set to no if all three conditions are met:
The New Unreleased/Backorder Quantity is zero.
The reserve inventory flag is yes.
The Shipment Type is warehouse.
6. If all of the above exception flags are no, the line availability exception flag is also set to no.
7. If the line availability exception flag is yes, the header availability exception flag is also set to yes.
G. Final Processing
1. The following quantities that are returned from the subroutine are converted from stockkeeping units back to order units:
Change in Original Release Quantity.
Change in Unreleased/Backorder Quantity.
Change in Subsequent Release Quantity (parent line).
Change in Unreleased/Backorder Quantity (parent line).
New Unreleased/Backorder Quantity.
On-Hand Quantity - Distribution (for display on line detail screen).
New Available Quantity (for display on line detail screen).
New Order Quantity (for display on line detail screen).
New Released Quantity.
2. If the Sales Order Planning Flag (SLPLFG) indicates that the sales order will be considered as demand by Master Scheduling/Requirements Planning, and if the part type is not reference, the update Item Master File flag is set to yes, and the net change flag is set on.
3. If rounding differences exist due to unit of measure conversions:
a. If the New Released Quantity is not zero, the rounding difference is added to it.
b. If the New Released Quantity is zero, the rounding difference is added to the New Unreleased/Backorder Quantity.
c. If the parent quantities have changed (blanket release or backorder release), rounding differences are also added to the parent:
(1) If the Change in Subsequent Release Quantity (parent line) is not zero, the rounding difference is added to it.
(2) If the Change in Subsequent Release Quantity (parent line) is zero, the rounding difference is added to the Change in Unreleased/Backorder Quantity (parent line).
4. If the New Released Quantity calculated in this subroutine is greater than the release quantity requested, it is because of rounding differences.
a. The New Released Quantity is set back to the release quantity requested.
b. The New Unreleased/Backorder Quantity is recalculated: New Order Quantity less the New Released Quantity.
5. On order quantities are converted to order unit of measure:
a. If the Shipment Type is direct, the On Order Quantity - Direct Ship P.O. is converted.
b. If the Shipment Type is warehouse, the On Order Quantity is converted to the order unit of measure.