Documentation >
MAC-PAC Technical Library >
Financial >
Inventory Accounting >
Programs >
Stock Transfers and Price Variance Report - Purpose >
Stock Transfers and Price Variance Report - Calculations
Stock Transfers and Price Variance Report - Calculations
IA540E
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. Key lists are defined for each file retrieved by the program.
3. Work fields are defined and program constants are initialized.
4. The system time is saved for printing on reports.
5. The Applications Installed are retrieved from Reference File category 012.
6. The Company Name is retrieved from the System Control file (CT100M). If this record is not found, a message is sent to the system operator, a default message is used, and processing continues.
7. The default Company Name for the Exception report is retrieved from the entity name record (category 002) on the Reference file (REFERP). If this record is not found, a default message is used, and processing continues.
8. A priming read is performed on the Report Requests file (IA320AP). If no records are found, an error message is printed on the Stock Transfers and Price Variance Report Request Exceptions report (IA540B), and processing is terminated.
B. Mainline
1. The Report Requests file (IA320AP) is read sequentially for all Stock Transfers and Price Variance Report Requests (Transaction Code = R54). Each request is processed as follows:
a. The request is checked to determine whether a range of companies or all companies have been requested.
b. If the request is for a range of companies, the request is validated for correct company range values: "to" value not less than "from" value. If the request is not valid, an error code and message are written to the Stock Transfers and Price Variance Report Request Exceptions report (IA540B).
2. The Inventory Journal Entry file (IA540AL) is read sequentially. If all companies have been requested, all records in the file are processed. Otherwise, only those records within the requested range are processed.
3. For each company processed:
a. The Company Name is retrieved from the entity name record (category 002) on the Reference file (REFERP).
b. All locations for the company are processed (see step 4 below) until a company break occurs.
c. Company totals are printed on the Stock Transfers and Price Variance Detail by Receiving Warehouse report (IA540A) and accumulated in the grand total.
4. For each location processed:
a. The Location Name is retrieved from the entity name record (category 002) on the Reference file.
b. All warehouses for the location are processed (see step 5 below) until a location break occurs.
c. Location totals are printed on the report and accumulated in the company total.
5. For each warehouse processed:
a. The Warehouse Name is retrieved from the Warehouse Description file (IC170M).
b. Each period for the warehouse is processed (see step 6 below).
c. The warehouse total is printed on the report and accumulated in the location total.
6. For each period processed:
a. All accounts within the period are processed (see step 7 below).
b. The period total is printed on the report and accumulated in the warehouse total.
7. For each account processed:
a. All parts that have been transferred to that account are processed (see step 8 below).
b. The account total is printed on the report and accumulated in the period total.
8. For each part that has been transferred, the following processing occurs:
a. Retrieve the Part Master (DE100M) record for each part. Check the Configuration Code Option (PMCFCO) to see if the part is configured costed (3 or 4).
b. All journal entries for that part or configuration code are processed (see step 9 below).
c. The configuration code totals are added to the part totals and printed on the report.
d. The part total is printed on the report and accumulated in the account total.
9. For each journal entry processed:
a. The sending warehouse data is retrieved from the Warehouse Description file (IC170M).
b. The Inventory Account Number for the sending warehouse is retrieved from the inventory account number assignment record (category 452) on the Reference file.
c. The Transfer Cost is calculated as follows:
Transfer
Cost
|
equals
|
Transfer
Balance
Quantity
|
times
|
Sending
Warehouse
Unit Cost
|
d. If the transaction is for a standard part/warehouse, the Receipt Value is calculated as follows:
Receipt
Value
|
equals
|
Receiving
Warehouse
Accounting Cost
|
times
|
Transfer
Balance
Quantity
|
If the transaction is for a moving average part/warehouse, the Receipt Value is calculated as follows:
Receipt
Value
|
equals
|
Sending
Warehouse
Unit Cost
|
times
|
Transfer
Balance
Quantity
|
e. The Price Variance, representing the difference between the value in the sending and receiving warehouses, is calculated as follows:
Price Variance
|
equals
|
Transfer Cost
|
minus
|
Receipt Value
|
f. A detail line is formatted and printed on the Stock Transfers and Price Variance Detail by Receiving Warehouse report (IA540A).
g. The Price Variance total is printed on the report and accumulated in the part total.
h. When overflow occurred when calculating total costs, a warning message is printed in the error report.
10. When all records from the Inventory Journal Entry file (IA540AL) are processed, a grand total is printed on the report. The report request record is deleted from the Report Request file (IA320AP). The next record is read and processed as above. This process continues until no more requests are found.
11. Any exceptions that occur during processing are captured and printed on the Stock Transfers and Price Variance Report Request Exceptions report (IA540B).