Documentation >
MAC-PAC Technical Library >
Financial >
Inventory Accounting >
Programs >
Accounting Code Changes Report - Purpose >
Accounting Code Changes Report - Calculations
Accounting Code Changes Report - Calculations
IA520E
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 the reports.
5. 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.
6. 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.
7. A priming read is performed on the Report Requests file (IA320AP). If no records are found, an error message is printed on the Accounting Code Changes Request Exceptions report (IA520B), and processing is terminated.
B. Mainline
1. The Report Requests file (IA320AP) is read sequentially for all Accounting Code Change Requests (Transaction Code = R52). Each request is processed as follows:
a. The request is checked to determine whether a range of companies and locations or all companies and locations has 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 Accounting Code Changes Request Exceptions report (IA520B).
2. The Inventory Journal Entry file (IA520AL) is read sequentially. If all companies and locations have been requested, all records in the file are processed. Otherwise, only those records within the requested range are processed.
3. For each company, the following processing is performed:
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. The company totals are printed on the report and accumulated into 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 (REFERP).
b. All accounts within the location are processed (see step 5 below) until a break in location occurs.
c. The location totals are printed on the report and accumulated into the company total.
5. For each account processed:
a. Each part within the account having an accounting code change journal entry is processed (see step 6 below) until a break in part number occurs.
b. Account totals are printed on the report and accumulated into the location total.
6. For each part having an accounting code change journal entry, the following processing is performed:
a. Each accounting code change transaction generates both a "Changed From" (type 510) journal entry and a "Changed To" (type 520) journal entry.
b. For each of these journal entries, a detail line is formatted and printed on the Accounting Code Changes report (IA520A).
(1) Each detail line lists both the Previous and New Account/Center and Accounting Code as well as the Part Number and Description, the quantity of inventory on hand, the Unit Cost, and the Net Change Amount.
(2) If the Unit Cost from the inventory journal entry record is zero, the part is costed as a moving average part and the Unit Cost must be calculated as follows:
Unit Cost
|
equals
|
Debit/Credit Amount
(CDCAMT)
|
divided by
|
Balance Quantity
(CBALQ)
|
c. Each Change Amount is accumulated in an account total.
7. When a break occurs in center, account, location or company, the Account Total Change Amount is formatted and printed on the Accounting Code Changes report (IA520A).
8. After all companies and locations are processed for a request, the request record is deleted from the Report Requests file (IA320AP). The next request is read and a new report generated as above. This process continues until the end of the Report Requests file is reached.
9. Any exceptions that occur during processing are captured and printed on the Accounting Code Changes Request Exceptions report (IA520B).