Documentation >
MAC-PAC Technical Library >
Distribution >
Synchro >
Programs >
Synchro Shipping and Billing Inventory Update - Purpose >
Synchro Shipping and Billing Inventory Update - Calculations
Synchro Shipping and Billing Inventory Update - Calculations
GA270E
A. Mainline
1. The shipment requests recorded in the Shipping and Billing Transaction file (GA270AP) are read in the MAINLN.
2. For each shipment requested, we access to the header level information (RDHLIN).
a. Several files are read:
(1) Shipping/Billing Header file to retrieve all the general shipment information.
Blanket Order file to retrieve financial information (vat code, currency code, payment terms, shipment terms).
Warehouse Description file to retrieve the company/location attached to the combination company/selling or sourcing warehouse.
Customer Master and Customer Address files to retrieve the identification of the customer and to lock the record to update the customer statistics.
Delivery Rules file to check if the rules exist.
(2) After these files are read, the Reference file is accessed to:
Determine if the book code is valid (category 136)
Retrieve the currency rate (Currency Master file)
Retrieve payment terms information (category 323)
If VAT environment, retrieve the VAT rate to apply on the sales (category 308) and determine the VAT type. VAT surcharge code and rates are retrieved at this point if the customer is subject to surcharge.
If U.S. Tax environment, retrieve the state (category 304), county (category 305) and city (category 306) tax rates.
(3) The VAT calculation subroutine is executed (VATCAL). (If VAT environment)
(a) Vat calculation
· Initialize accumulators to process VAT
· Read the Shipping and Billing Line file (GA145M2) until there are no more lines attached to the current header record. For each line, the unit price and the conversion factors are retrieved from the Endorsement Master file (GA120M3). The Warehouse Description file is read to determine if the item is subject to the cash-discount. The unit price and extended price are computed in original and bookkeeping currency.
· If the freight is required (freight flag = 'N' and percentage of freight greater than zero) and the VAT type is not suspended, the Warehouse Balance file is read to retrieve the VAT code applied to the freight. The VAT rate is retrieved from Reference File category 308 (VAT Rate). VAT surcharge code and rate are retrieved if the customer is subject to surcharge.
· If the VAT calculation is net (category 132) then the cash discount is applied to the sales subject to the cash discount.
· The total of sales subject and not subject to the cash discount are added to determine the sales amount subject to VAT.
· Compute the VAT and the VAT surcharge, if it exists, on the sales amount.
· Compute the VAT and the VAT surcharge, if it exists, on the freight amount.
· If the VAT type is not suspended and the VAT code on both the freight and sales are equal, then add the two VAT amounts.
· If VAT suspended is required, the actual year-to-date VAT suspended amount is retrieved from the Customer Master file and the VAT on the sales and freight are added to it. Check if the amount is not over the VAT suspended limit amount. If it is not the case then vat suspended must be applied.
· The Reference file is accessed to retrieve the VAT account/center number. Read the General Ledger Master file to retrieve the account description. The same process is done for VAT surcharge if it exists.
(4) If U.S. Tax environment, perform tax processing (TAXPRC) at the state, county and/or city levels.
(5) Retrieve the A/R account and center number from the Reference File (category 302). Return the account description and accounting currency from the General Ledger Master file (GLFILEL5). Initialize the header level financial accumulators.
3. For each shipment, the shipment order process is executed (SHPORD):
a. Set the posting period (current or next period).
b. The program read only the shipping list not processed (record posted flag = 'N').
(1) Retrieve the document type from the Blanket Order Header'' Retrieve the document number from either Reference File category 440 or M12.
(2) Perform line processing (LINPRC).
(a) Read the Shipping/Billing Line (GA145M2). Access to the subroutine Read Level Line (RDLLIN) with a quantity shipped greater than zero.
· Set the costing method.
· Read the Warehouse Balance file (IC140M) to update later sales statistics.
· Read the Item/Delivery Point file (GA120M2) to check if the relationship exists. If not, the program ends abnormally.
· Read the Endorsement file (GA120M3) to retrieve the unit price, factors of conversion , and units of measure.
· Read the Part Master file (DE100M) to retrieve the actual net change flag.
· Compute unreleased/backorder quantity, accumulate order quantity.
· Access to the costing subroutine (COSTNG) to set the unit cost.
· Compute unit price, extended, original and bookkeeping
· Set the discount flag if the program has to calculate a cash-discount. If the customer allow discount flag is yes and the subject to cash discount flag from the warehouse balance is yes then cash-discount must be applied.
· Access to Reference File category 302 to retrieve the account and center number assign to the sales. Read the General Ledger Master file (GLFILEL5) to retrieve the account description.
(b) Process the inventory updates for this line if labels exist. The Labels Master file (GA160MLB) is read. If no labels are found, access the line location update subroutine (LLCUPD) with a lot flag to 'N'. If there is label, analyze the type of label to process. and access to the line location update subroutine (LLCUPD) with a lot flag to 'Y'.
· Write a record to the Sales Order Shipment/Returns Audit Trail (IC190BP), in the Sales order Shipment/Returns Transaction Register (IC190CP) and in the Sales Order History (OP120M).
· If part type is not a reference part, set the balance type.
· Read the Multiple Location Line (IC130M) for the current line location (key = part/co/whse) and initialize one if it is not found.
· If the balance type is '1', '2', '3', '4' decrease the on-hand warehouse balance and the multiple location balance by the amount shipped. If the balance quantity drops below zero, write a warning in the Inventory Control Transaction Error file (IC505AP). Update warehouse balance statistics(add the shipped quantity-sku to the year-to-date activity amount and the activity since last count amount).
· Update the Multiple Location Line (IC130M)
· If the part is not a reference part and if the shipped quantity is greater than the release quantity and it's a manufacturing balance then set the net change flag on the Part Master file to '1'.
(c) Access to the Line Update subroutine (LINUPD).
· Format the Open Item Distribution fields for the sales records, access to the subroutine (FMTOID).
· Update the Warehouse Balance file (IC140M) concerning the sales statistics (year-to-date shipped order lines, cost of sales, shipped sales amount, shipped order quantity and reduce the part value posting by the extended shipped amount). Determine the costing method used. If the costing method is 'moving average' divide the part value by the total on-hand balance (1, 2, 3, 4).
· Update the net change flag on the Part Master file (DE100M) to '1'.
· Write a sales journal entry record in the Accounting Transaction file (AR510AP).
· Update the header level financial accumulators.(total order amount, total sales amount, type of sales).
(3) Perform freight process subroutine (FRTPRC).
(a) The freight is computed when the percentage of freight is greater than zero and the freight flag is equal to 'N'.
· Compute the freight amount in original and bookkeeping currency (sales amount times percentage of freight).
· Add the freight amount to the total of the other charges.
· Read the Warehouse Balance file (IC140M) with the freight part from the Reference File (cat 413).
· If it is a VAT environment, and the VAT code from the Warehouse Balance (IC140M) for the freight is not equal to the VAT code from the Blanket Order file (GA120M1) applied to the sales, access the Reference File (category 302) to retrieve the account and center number for the freight. Access the General Ledger file (GLFILEL5) to retrieve the account description. If the two VAT codes are equal, one VAT record for both the sales and the freight will be written to the Open Item Distribution file (ARDISTP) and the Accounting Transaction file (AR510AP). If the customer is subject to surcharge and the VAT code from the Warehouse Balance file has a surcharge code associated with it, the same process for VAT code will be repeated for the surcharge code.
· Update the Warehouse Balance file (IC140M) for the sales statistics (shipped order lines, cost of sales, shipped sales amount, last maintenance operator, last maintenance date, time).
· Format and write a record in the Open Item Distribution file (ARDISTP) for the freight amount. If the VAT code applied to the freight is different from the VAT code applied to the sales, format and write a vat record in the Open Item Distribution file. A surcharge record will also be created for the VAT surcharge.
· Write a record in the Sales History file (OP120M).
· Format and write a record in the Accounting Transaction file (AR510AP) for the freight amount. If the VAT code applied to the freight is different of the VAT code applied to the sales, format and write a VAT record to the Accounting Transaction file (AR510AP). A surcharge record will also be created for the VAT surcharge.
(4) Perform comments process subroutine (COMPRC)
(a) If a comment record is found in the Shipping and Billing Comments file (GA145M3),access the subroutine (COMUPD) to update the Sales Order Comments file (ARCMTSP).
· Format and write a comment record for each comment record from the Shipping and Billing Comments file.
(5) Perform header level process subroutine (HDRUPD).
(a) Update the header level files
· Add total VAT amount to the sales total.
· Format and write a VAT record to the Open Item Distribution file (ARDISTP). This transaction can be the result of the VAT on sales amount + VAT on freight amount (See FRTPRC subroutine) If VAT surcharge exists, a record will be created to the Open Item Distribution file.
· Format and write a VAT record in the Accounting Transaction file (AR510AP). This transaction can be the result of the VAT on sales amount + VAT on freight amount (See FRTPRC subroutine). If VAT surcharge exists, a record will be written to the Accounting Transaction file.
· Update the statistics fields on the Customer Name and Address file (number of orders shipped, cost of sales, total of other charges (freight), the non-cash sales amount, the last shipment date, last maintenance fields).
· Update the statistics fields on the Customer Master (order balance amount, customer A/R balance amount, total order amount, year-to-date /period to date sales total, last transaction accounting fields).
· Determine if the aging period should be updated, access the AGING subroutine.
· Format and write a record to the Open Item Header file (AROPENP). This transaction is the total of the sales plus VAT plus freight and takes any cash discounts into account.
· Format and write an Accounts Receivable data base activity record to the Activity Log file (ARLOGP).
· Format and write the Accounts Receivable record to the Accounting Transaction file (AR510AP).
· Format and write the invoice record in the invoice Request file (GA235AP). This transaction is done only if the immediate invoice print flag is set to 'I'.
· Format and write the Open Item Request record in the Open Item Request file (OP535AP). This transaction is done only if the immediate invoice print flag is set to 'I'.
· Update the Shipping and Billing Header file (GA145ML6). Set the header posted flag to 'Y' and the last maintenance update fields).
· If the VAT is suspended, update the customer year-to-date VAT suspended amount by the VAT amount computed in the VAT calculation subroutine (VATCAL).
c. If there were errors while posting, send an unsuccessful message. If no errors occurred, send a successful message to the requested workstation.
4. Send a message to GAASYNCMON monitor to print the Shipping List report.