Documentation >
MAC-PAC Technical Library >
Financial >
Accounts Receivable >
Programs >
Batch Invoice Debit/Credit Memo Post - Purpose >
Batch Invoice Debit/Credit Memo Post - Calculations
Batch Invoice Debit/Credit Memo Post - Calculations
AR090P
A. Mainline
Information is retrieved from the following Reference File categories.
1. Entity Name Record
This Reference File record (category 002) contains all valid company and location codes. The company/location listed on an add transaction must exist on this record to be considered valid.
2. Date Format Record
This Reference File record (category 049) contains the date format indicator. If this record is not found, a message is sent to the system operator, the date format defaults to MMDDYY, and processing continues.
3. Account Description Record
This Reference File record (category 113) contains the valid accounts and account types for each location in the system.
4. Account Number Assignment Record
This Reference File record (category 302) contains a listing of valid account receivable codes and bank codes for each company/location.
5. State Tax Information Record
This Reference File record (category 304) contains all valid state tax codes.
6. County Tax Information Record
This Reference File record (category 305) contains all valid county tax codes.
7. City Tax Information Record
This Reference File record (category 306) contains all valid city tax codes.
8. Value Added Tax/Goods and Services Tax Information Record
This Reference File record (category 308) contains value added tax/GST code information. If a valid value added tax code or GST is specified on a transaction, it must exist on this record. The value added tax/GST processing option is found on Reference File category 132. Provincial Tax Code information Record. This reference file record (category 348) contains provincial tax code information. If a valid PST code is specified on a transaction, it must exist on this record.
9. System Defaults Record
This Reference File record (category 133) contains the single/multiple currency option.
10. Document Type Defaults Record
This Reference File record (category 328) contains the default document type codes for invoices and credit memos.
11. A/R Document Types
This Reference File record (category 329) contains the valid document types for the Accounts Receivable, Order Processing, Draft Management, and Synchro modules. It contains valid open item document types along with corresponding user-defined descriptive names, specific groups for the document type, and document sector information.
12. Document Fiscal Sectors
This Reference File record (category M19) is contains the sector type and other information related to fiscal sectors management.
13. External Numbering program
This Reference File record (category M12) contains user-defined external programs that allow you to override document numbering schemes currently allowed in MAC-PAC.
14. Discount Information Record
This Reference File record (category 331) contains the maximum discount percentage and grace period days.
15. Accounts Receivable Codes Record
This Reference File record (category 333) contains all accounts receivable codes.
16. Company/Location Options Record
This Reference File record (category 336) contains the earliest valid accounting date and the latest valid accounting date.
17. Account Classes Record
This Reference File record (category 340) contains the account class codes.
18. Aging Periods Record
This Reference File record (category P44) contains the number of days in each aging period and a flag which indicates if aging should be performed.
19. A/R Defaults Record
This Reference File record (category 300) contains the default values for A/R code, bank code, company/location, validate reference number, and age credit note.
20. Location Defaults Record
This Reference File record (category 132) contains the default currency operand and the type of Journal numbering used.
21. Adjustment Reason Code Record
This Reference File record (category 432) contains the valid adjustment reason codes.
22. Salesperson Record
This Reference File record (category 315) contains the salesperson codes and their descriptions.
23. Default Book Code Record
This Reference File record (category 135) contains the default book codes for each conversation-bank code combination.
24. Valid Book Codes Record
This Reference File record (category 136) contains the valid book codes to be used in processing.
25. Conversion Record
This Reference File record (category 006) contains the conversion data necessary to convert one unit of measure to another.
26. Installed Applications
This Reference File record (category 012) contains a listing of modules installed.
27. Payment Type
This Reference File record (category 344) contains all valid payment type codes.
28. Next Available Draft Number
This Reference File record (category F34) contains the next available draft number used at the time of draft creation.
29. Remittance Procedure
This Reference File record (category F45) defines the remittance procedure for a payment type.
30. Value Added Tax Types
This reference file record (category 024) contains the valid VAT types.
31. Batch Header Record and Batch Detail Record
If program is in standard mode, ARORDL1 is read, else if chargeback mode, ARORDL2 is read.
The Order Processing Transactions file is read sequentially. After each record is read, a determination is made as to whether a header or detail record was read and then the record is processed accordingly.
If a header record is being processed, extensive validation is performed on many of the fields to ensure validity and consistency. This validation is dependent upon whether the record's transaction type is add or change. Once the validation has been completed, the record is moved to a set of work fields to be used when the transaction is complete. If the item is a credit memo, it will be posted according to its due date or the due date of the matching invoice, depending on the value in the Age Credit Note field on Reference File category 300.
If a detail record is read, a check is made to ensure that a header record has already been read for this detail record. If the detail exists without a header record, it is output without further validation to the Batch Open Item Post Error report and the record is written to the Order Processing Error Transaction file. Detail records with headers are validated and written to the Batch Open Item Post work file. When all of the detail records have been processed, a check is made to see if any validation errors occurred for the header record or any detail records. A check is also made to verify that the count, quantity, and amount fields on the header tie to the detail records. If the transaction is error free, it is written to the Batch Open Item Post Valid Transactions report and the Open Item file is updated accordingly. If any errors exist, the transaction is written to the Batch Open Item Post Error report along with the appropriate error messages, and the records are written to the Order Processing Transactions file.
If the payment terms indicate that the open item is to be paid in installments, the program will call the Installments generation program (CF170E). This program will calculate installment amounts and due dates to be used in the update of the Open Item file.
Because of the way the logical file keys have been set up for the Order Processing Transactions file, it is not valid to have more than one change transaction for a given open item in the same batch. If more than one change is required, verify that these change transactions are submitted with different batch numbers.
If program is in standard (batch) mode, when all batch header records and detail header records have been processed, the last record (LR) indicator is set on, and program execution is halted. If program is in chargeback mode, control is returned to the Payment Entry and Application program, AR120E.
32. Open Item Header Record
The Open Item file is accessed for both add and change transactions. If the record is found on an add transaction, an error has occurred. It is not permissible to write the same header more than once. An invalid condition also occurs if no open item header record is found for a change transaction. When a valid add transaction is processed, a new open item header record is formatted and output to the Open Item file. Default values are used for Order Processing fields on the Open Item file. When a valid change transaction is processed, the old open item header is updated to reflect that it is no longer the most recent open item header, and then a new open item header is written to incorporate the changes.
33. Customer Master Record
The customer master record is updated for each valid transaction processed. The year to date and period to date sales and discount fields, the accounts receivable balance dollar days overdue, and all the aging categories are incremented as appropriate.
34. Control Breaks
Control break totals are printed on both the Batch Open Item Post Valid Transactions and Error reports for changes in batch number and company/location. A grand total line is also printed. The Valid Transaction report only lists header totals while the Batch Open Item Post Error report lists header and detail totals since they do not necessarily have to agree.
Batch
A batch control break indicates a change in the batch number between two records on the Order Processing Transactions file. Batch totals are added to the company/location totals and a batch total line is written to the appropriate report.
Company/Location
A company/location control break indicates a change in the company or location fields between two records. Company/location totals are added to the grand totals and a company/location total line is written to the appropriate report.
35. Open Item Distribution Record
The open item is accessed for both add and change transactions. If the record is found on an add transaction, an error has occurred. An invalid condition also occurs if no open item distribution is found for a change transaction. When a valid add transaction is processed, a new open item distribution record is formatted and output to the Open Item file. When a valid change transaction is processed, the old open item distribution is updated to reflect that it is no longer the most recent open item header, and the new open item distribution is written to incorporate the changes.
36. Draft Master Record
The draft record is written if customer is not defined with payment on statement basis, the document type is invoice or document type is debit/credit memo, the gross amount is greater than zero, and the payment type is a bill of exchange.
Order Processing Header Record (ARORDHP)
Relative Position
|
Field Label
|
Field
Desc
|
DEC
|
Bytes
|
Field Form
|
A/N
|
Required/Option
|
1-1
|
OPTRTC
|
Transaction Type Code
|
|
1
|
C
|
A
|
Required
A - Add
C - Change
|
2-4
|
OPCO
|
Company Code
|
|
3
|
C
|
A
|
Required
|
5-7
|
OPLOC
|
Location Code
|
|
3
|
C
|
A
|
Required
|
8-9
|
OPDTC
|
Document Type Code
|
|
2
|
C
|
A
|
Required
|
10-17
|
OPDNO
|
Document Number-Alpha
|
|
8
|
C
|
A
|
Required
|
18-28
|
OPCUST
|
Customer Identification Number
|
|
11
|
C
|
A
|
Required
|
29-39
|
OPSTCN
|
Ship-to
Customer
|
|
11
|
C
|
A
|
Required
|
40-69
|
OPCNLN
|
Customer name
|
|
30
|
C
|
A
|
Optional, Default from Customer
|
70-99
|
OPADL1
|
Address
Line 1
|
|
30
|
C
|
A
|
Optional, Default from Customer
|
100-129
|
OPADL2
|
Address
Line 1
|
|
30
|
C
|
A
|
Optional, Default from Customer
|
130-159
|
OPADL3
|
Address
Line 1
|
|
30
|
C
|
A
|
Optional, Default from Customer
|
160-176
|
OPCITY
|
City
|
|
17
|
C
|
A
|
Optional, Default from Customer
|
177-178
|
OPSTE
|
State
|
|
2
|
C
|
A
|
Optional, Default from Customer
|
179-187
|
OPZIP
|
Zip
|
|
9
|
C
|
A
|
Optional, Default from Customer
|
188-190
|
OPCTRY
|
Country
|
|
3
|
C
|
A
|
Optional, Default from Customer
|
191-192
|
OPACYR
|
Accounting year
|
|
2
|
C
|
N
|
Optional, Default from Document Date
|
193-194
|
OPACMO
|
Accounting month
|
|
2
|
C
|
N
|
Optional, Default from Document Date
|
195-196
|
OPACDY
|
Accounting day
|
|
2
|
C
|
N
|
Optional, Default from Document Date
|
197-198
|
OPDCYR
|
Document year
|
|
2
|
C
|
N
|
Required
|
199-200
|
OPDCMO
|
Document month
|
|
2
|
C
|
N
|
Required
|
201-202
|
OPDCDY
|
Document day
|
|
2
|
C
|
N
|
Required
|
203-204
|
OPDIYR
|
Discount year
|
|
2
|
C
|
N
|
Required for invoices which do not have installments; must be blank for invoices using an installment payment type
|
205-206
|
OPDIMO
|
Discount month
|
|
2
|
C
|
N
|
Required for invoices which do not have installments; must be blank for invoices using an installment payment type
|
207-208
|
OPDIDY
|
Discount day
|
|
2
|
C
|
N
|
Required for invoices which do not have installments; must be blank for invoices using an installment payment type
|
209-210
|
OPDUYR
|
Due year
|
|
2
|
C
|
N
|
Required for invoices which do not have installments; must be blank for invoices using an installment payment type
|
211-212
|
OPDUMO
|
Due month
|
|
2
|
C
|
N
|
Required for invoices which do not have installments; must be blank for invoices using an installment payment type
|
213-214
|
OPDUDY
|
Due day
|
|
2
|
C
|
N
|
Required for invoices which do not have installments; must be blank for invoices using an installment payment type
|
215-216
|
OPARCD
|
Accounts Receivable Code
|
|
2
|
C
|
A
|
Optional, default from customer
|
217-218
|
OPBKCD
|
Bank Code
|
|
2
|
C
|
A
|
Optional, default from customer for invoices that do not have installments; must be blank for invoices using an installment payment type
|
219-222
|
OPSTXC
|
State tax code
|
|
4
|
C
|
A
|
Optional, default from customer
|
223-226
|
OPCOXC
|
County tax code
|
|
4
|
C
|
A
|
Optional, default from customer
|
227-230
|
OPCIXC
|
City tax code
|
|
4
|
C
|
A
|
Optional, default from customer
|
231-233
|
OPCUCD
|
Currency code
|
|
3
|
C
|
A
|
Optional in multi-currency environment; default from customer
|
234-238
|
OPEXCH
|
Exchange rate
|
5
|
5
|
P
|
N
|
Required in multi-currency environment
|
239-239
|
OPFDROP
|
Operation
|
|
1
|
C
|
A
|
Optional
|
240-264
|
OPPON
|
Customer Purchase Order Number
|
|
25
|
C
|
A
|
Optional
|
265-272
|
OPSON
|
Reference Order Number
|
|
8
|
C
|
A
|
Optional
|
273-282
|
OPAREF
|
Adjustment Reference Number
|
|
10
|
C
|
A
|
Optional
|
283-292
|
OPOREF
|
Open Item Reference Number
|
|
10
|
C
|
A
|
Optional
|
293-296
|
OPBNO
|
Batch Number
|
|
4
|
C
|
A
|
Optional
|
297-299
|
OPSPC1
|
Salesperson
1 code
|
|
3
|
C
|
A
|
Optional
|
300-317
|
OPHDSC
|
Open item header description
|
|
18
|
C
|
A
|
Optional
|
318-319
|
OPHCNT
|
Open item distribution item count
|
|
3
|
P
|
N
|
Required
|
320-326
|
OPOAMF
|
Original open item gross - orig. currency
|
2
|
7
|
P
|
N
|
Required
|
327-332
|
OPORDF
|
Original open item discount - orig. currency
|
2
|
6
|
P
|
N
|
Required
|
333-337
|
OPHQTY
|
Order Quantity
|
3
|
5
|
P
|
N
|
Optional
|
338-339
|
OPRSCD
|
Inventory Adjustment Code
|
|
2
|
C
|
A
|
Optional
|
340-341
|
OPBOOK
|
Book Code
|
|
2
|
C
|
A
|
Optional
|
342-342
|
OPINFL
|
VAT IN-100
Flag
|
|
1
|
C
|
A
|
Optional
|
343-362
|
OPAUTN
|
Exon./Susp.
Auth. No.
|
|
20
|
C
|
A
|
Optional
|
363-364
|
OPPMCD
|
Payment
Terms
|
|
2
|
C
|
A
|
Optional
|
Order Processing Distribution Record (ARORDDP)
Relative Position
|
Field Label
|
Field Description
|
POS
|
DEC
|
Bytes
|
Field Form
|
A/N
|
Required/
Option
|
1-4
|
OTBNO
|
Batch Number
|
4
|
|
4
|
C
|
A
|
Optional
|
5-5
|
OTTRTC
|
Transaction Type Code
|
1
|
|
1
|
C
|
A
|
Required, must agree with header
|
6-8
|
OTCO
|
Company Code
|
3
|
|
3
|
C
|
A
|
Required, must agree with header
|
9-11
|
OTLOC
|
Location Code
|
3
|
|
3
|
C
|
A
|
Required, must agree with header
|
12-13
|
OTDTC
|
Document Type Code
|
2
|
|
2
|
C
|
A
|
Required, must agree with header
|
14-21
|
OTDNO
|
Document Number - Alpha
|
8
|
|
8
|
C
|
A
|
Required, must agree with header
|
22-26
|
OTMARF
|
Major Reference
|
5
|
|
5
|
C
|
A
|
Optional
|
27-30
|
OTMIRF
|
Minor Reference
|
4
|
|
4
|
C
|
A
|
Optional
|
31-40
|
OTDRAC
|
Account Number
|
10
|
|
10
|
C
|
A
|
Required
|
41-50
|
OTDRCT
|
Center Number
|
10
|
|
10
|
C
|
A
|
Required
|
51-51
|
OTDSCD
|
Subject to Discount Flag
|
1
|
|
1
|
C
|
A
|
Required
Y - Yes
N - No
|
52-56
|
OTDQTY
|
Order Quantity
|
9
|
3
|
5
|
P
|
N
|
Optional
|
57-58
|
OTUOMC
|
Unit of Measure Code
Required if Quantity Entered
|
2
|
|
2
|
C
|
A
|
Optional
|
59-76
|
OTDDSC
|
Open item distribution description
|
18
|
|
18
|
C
|
A
|
Optional
|
77-83
|
OTDAMF
|
Open item distribution amount - orig. currency
|
13
|
2
|
7
|
P
|
N
|
Required
|
84-98
|
OTPTNO
|
Part Number
|
15
|
|
15
|
C
|
A
|
Optional
|
99-100
|
OTVTCD
|
Value added tax code
|
2
|
|
2
|
C
|
A
|
Required if in a VAT, GST environment
|
101-102
|
OTSECD
|
VAT Surcharge Code
|
2
|
|
2
|
C
|
A
|
Required if customer is subject to VAT surcharge
|
103-103
|
OTVTFL
|
VAT Flag
|
1
|
|
1
|
C
|
A
|
Required, must be Y or N. For distribution lines associated to VAT/GST, this flag will have a 'Y' value. The program will automatically calculate VAT and VAT surcharge lines. The header values will be validated against the total amounts and the total number of lines (distribution + VAT). For distribution lines that are not associated to VAT/GST, the value will be 'N'.
|