MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Technical Library > Financial > Accounts Payable > Programs > Invoice/Receipt Match - Purpose > Invoice/Receipt Match - Calculations

Invoice/Receipt Match - Calculations

AP140E

 

A.   Housekeeping

1.   All parameters, key fields, literals, and variables are set up.  All indicators are initialized.

a.   The date format record (category 049) is retrieved.  If this record is not found, a message is sent to the system operator, the date format defaults to MMDDYY, and processing continues.

b.   The decimal precision for quantity fields (category 446) is retrieved.  If this record is not found, the program will terminate.

3.   The Purchase Order Header file (PO180M1) is locked to prevent another user from updating the purchase order during processing.

4.   The next processing step is determined from the input variable PRCOPT.  Valid values are:

A-Add transaction

R-Reset transaction

C-Cancel transaction

5.   The currency code array is loaded using category D89.  Base Currency is processed and a check is made to see whether any decimals are allowed in the Base Currency field. 

B.   Mainline

1.   The processing flow is controlled by the next step field (NXTSTP).  Processing depends on whether the invoice line:

·     Is currently matched but needs to be reset

·     Is being matched

2.   If the invoice line is being reset:

a.   The Invoice Receipt Match file (AP140M) is read to determine which receipts were matched against the invoice line.

b.   The Receipt Detail file (PO212ML7) is read for each matched receipt.  The quantity field is updated to reflect that the quantity is no longer matched against this invoice.

c.   The record is updated to an inactive status and delete date recorded Invoice/Receipt Match file (AP140M).

d.   If any exception records were written for the match, they are deleted from the Invoice/Receipt Transaction file (AP140AP).

e.   The purchase order header record is unlocked and the program ends.

3.   If the invoice is being matched, the program checks for purchase order records and purchase order receipt records that match the information on the invoice.

a.   The Purchase Order Header file (PO181ML4) is read to verify that the purchase order selected for matching is a valid purchase order.  To be valid, the purchase order must have the same vendor and currency code as those specified on the invoice.

b.   The Warehouse Description file (IC170M) is read to verify that the purchase order selected for matching belongs to the originating company/location from the invoice line.

c.   The Purchase Order Detail file (PO182ML4) is read to determine which purchase order detail lines are for the same part number and unit of measure as the line selected for matching.

d.   For each purchase order detail line, the Purchase Order Receipt Header file (PO210ML1) and the Purchase Order Receipt Detail file (PO212ML6 or PO212ML9) are used to retrieve all open receipt lines for the part on the invoice.  Each open receipt line is written to the detail subfile.

4.   Beginning with the first (oldest) receipt line, the quantity on the invoice line is allocated to the receipt records until it is exhausted.  If all receipts have been matched, and invoice quantity remains, the excess is allocated to the last receipt.  The match status of the line is set to yes only if the quantity invoiced to the receipt is greater than or equal to the uninvoiced receipt amount.

5.   The program calculates:

·     The total invoice amount that is being matched to receipts

·     The total invoice quantity that is being matched to receipts

·     The total receipt amount that is being matched

·     The total receipt quantity that is being matched

·     The differences between the invoice and receipt amounts and quantities

·      The tolerance percentages for the quantity and amount variances

6.   If in manual match environment, the detail subfile is displayed indicating which of the open receipt lines have been matched to the invoice.  For any receipt, the user can change the quantity invoiced to the receipt.  Changes are validated to ensure that the total quantity invoiced to the receipt lines equals the quantity entered on the invoice distribution line.  If any changed are invalid, an error message is displayed.

7.   The detail subfile also displays the matched status of the open receipt lines.  For any receipt with a matched status of N (not fully matched), the user can force the status to Y (fully matched) by entering a Y on the line.  Once the status of a line is set to Y, the system will no longer recalculate the status if the quantity is changed.  If the user wants the status of the line recalculated, the field should be blanked out before the ENTER key is pressed.

8.   If all changes are valid, the files are updated when the user presses F22 (manual match environment).  In automatic match, the files are updated with no user response if variances are within tolerance tests on category D39 and no warning is required.  If the tolerance process flag is set to hold, the match will be completed and the open item placed on hold. 

a.   The adjustment quantity (ADJ AMT) and the adjustment amount (ADJ AMT) are calculated for each receipt.  These are the values by which the Purchase Order Accrual Account will be updated.

RCT QTY

=

uninvoiced receipt quantity

RCT AMT

=

uninvoiced receipt amount

INV QTY

=

quantity invoiced to a receipt

INV AMT

=

INV QTY x INV UNIT COST

ADJ QTY

=

RCT QTY

 

 

(if matched status = Y)

 

=

INV QTY

 

 

 

 

 

(if matched status = N)

ADJ AMT

=

RCT QTY x RCT UNIT COST

 

 

(if matched status = Y)

 

=

INV QTY x RCT UNIT COST

 

 

(if matched status = N)

b.   Any variances that are created as a result of the match are calculated as follows:

Quantity Variance -

QTY VAR

=

(INV QTY - ADJ QTY) * RCT UNIT COST

 

Purchase Price Variance -

PP VAR

=

INV AMT - (INV QTY * RCT UNIT COST)

Exchange Rate Variance -

EXC VAR

=

ADJ AMT in book at current exchange rate

 

 

- ADJ AMT in book at historic exchange rate.

Inventory Accounting Adjustment Variance -

IA AJ VAR

=

ADJ AMT calculated using quantities and costs on Purchasing UOM.

 

 

- ADJ AMT calculated using quantities and costs based on Stockkeeping UOM.

c.   The program then checks for any exceptions and writes them to the Invoice/Receipt Transaction file (AP140AP).  An exception occurs if any of the variances calculated above are not equal to zero.

d.   The Receipt Detail file (PO212ML7) and the Invoice/Receipt Match file (AP140M) are read for update.  If the record is not found on the Invoice/Receipt Match file, a new record is written.  Otherwise, the old record is updated.  The quantity fields on the Receipt Detail file are updated.

9.   The purchase order header record is unlocked and the program ends.

AP140E Program Menu