Functional Description
Purpose
This function is used to find invoices using a generic reference number. The reference number can be
an invoice number, sales order number, customer reference number, or statement number. The function
attempts to match against invoices in the order specified until at least one invoice is found. This
function stores all records found to a temporary cache for later retrieval. The total number of pay items
found is returned. Also, the total open amount, discount available, and discount earnable of the found
pay items is returned. The function returns the type of match that was successful. If no invoices
were found, the match type will be blank.
Setup Notes and Prerequisites
The Invoice Selection Create Cache (B03B0172) function must be called first to create the temporary
cache used to hold any invoice pay items found. Call the Receipts Entry Read Cache (B03B0142) function
in a loop to retrieve each pay item from the temporary cache. Once completed, call the Invoice
Selection Destroy Cache (B03B0172) function to free the memory used by the cache. Other functions in the
B03B0172 family may be used to add, delete, and check for records in the cache.
Special Logic
This function will perform a match on all open invoices using the generic reference number and other
passed criteria. The search order is based on the values for cInvoiceMatchPriority,
cSalesOrderMatchPriority, cCustomerRefMatchPriority, and cStatementMatchPriority. A '1' is the highest priority and a
'4' is the lowest priority. Each match process will be run in priority order until at least one invoice
pay item is found. These values can be overriden by passing a value in cOverrideMatchType. Use a '1'
for invoice match, '2' for sales order match, '3' for customer reference match, and '4' for statement
match.
If amounts are passed on mnCustomerAmountApplied and mnCustomerDiscountTaken, a balance forward
method of application will be applied to any found invoice pay items. If only one item is found, the entire
amount is applied. If multiple pay items are found, the amount applied will be the lesser of the
amount remaining to be applied and the invoice open amount. The discount will be the lesser of the total
discount taken remaining and the invoice discount available. Any remaining amounts after all invoice
pay items have been applied will be discarded.
Technical Specification
Parameters
Item DescriptionI/OReq?Notes
MATH01mnMatchLineIDIYLine number used to identify the results of the match.
GMFDszGenericReferenceNumberIYNumber used to match against invoices.
MAPRTcOverrideMatchTypeIYType of match to execute. Overrides the match order
specified on the processing options.
DCTszDocumentTypeINDocument Type of the Invoice. Used to filter invoices.
KCOszDocumentCompanyINDocument Key Company of the Invoice. Used to filter
invoices.
SFXszDocumentPayItemINDocument Pay Item of the Invoice. Used to filter
invoices.
PYRmnPayorNumberINPayor Number of the Invoice. Used to filter invoices.
AN8mnCustomerNumberINCustomer Number of the Invoice. Used to filter
invoices.
PA8mnParentNumberINParent Number of the Invoice. Used to filter invoices.
COszCompanyINCompany Number of the Invoice. Used to filter
invoices.
BCRCszBaseCurrencyIYRequired if currency is on. Company Base Currency
Code. Used to filter invoices.
CRRMcCurrencyModeIYRequired if currency is on. The mode specifies the
currency of the output amounts.
CRCDszTransactionCurrencyIYRequired if currency is on and the mode is foreign.
Used to filter invoices.
DGJjdDateGLIYTransaction's G/L Date. Determines whether a discount
is earnable or not.
PIDszProgramIDIYProgram ID of the calling program.
EV01cPayApprovedInvoicesOnlyIY1- Only select approved Invoices BLANK allow Held
Invoices to be selected.
GPDmnGracePeriodDaysIYGrace days to extended discount due date.
EV02cInvoiceMatchPriorityIYA value 1-4 priority to assigned to search Generic
Reference as a Invoice Number.
EV03cSalesOrderMatchPriorityIYA value 1-4 priority to assigned to search Generic
Reference as a Sales Order Number.
EV04cCustomerRefMatchPriorityIYA value 1-4 priority to assigned to search Generic
Reference as a Customer Reference.
EV05cStatementMatchPriorityIYA value 1-4 priority to assigned to search Generic
Reference as a Statement Number.
NINFDmnTotalPayItemsO Total number of Pay Items.
AAPmnTotalAmountOpenO Total open amount of found invoices.
ADSCmnTotalDiscountAvailableO Total discount available of found invoices.
EDSCmnTotalDiscountEarnableO Total discount earnable of found invoices.
EV06cReturnMatchTypeO Type of match that produced a successful search. This
value is blank if no invoices were found.
PAAPmnCustomerAmountAppliedINIf used, specifies how much to apply to the pay items
found.
ADSAmnCustomerDiscountTakenINIf used, specifies how much discount to take on the
pay items found.
TCRCszReceiptCurrencyCodeINRequired if Receipt is in alternate currency. Receipts
Currency Code.
CRRmnCurrencyConverRateOVINRequired if Receipt is in alternate currency. Exchange
Rate between receipt and invoice transaction.
CRR1mnTriangulationLeg1INRequired if Receipt is in alternate currency. Exchange
Rate Leg 1.
CRR2mnTriangulationLeg2INRequired if Receipt is in alternate currency. Exchange
Rate Leg 2.
CRCMcCurrencyConversionMethodINRequired if Receipt is in alternate currency. Currency
Conversion Method.
ERDJjdExchangeRateDateINRequired if Receipt is in alternate currency. Exchange
Date.
CRRmnReceiptSpotRateINRequired if foreign receipt is paying a domestic only
invoice where the receipt base currency is the same as the invoice currency - in such a case the spot
rate will be used.
Related Tables
F03B11Customer Ledger File
F03B21A/R Notification History Detail
Related Functions
B03B0158Maintain Receipts Entry Cache
B03B0172Maintain Invoice Selection Cache
Processing
Initialize return values.
Validate all required parameters.
Sort match processes in priority order.
Clear the cache of any existing records by mnMatchLineID.
If cOverrideMatchType has been specified,
Execute GenericMatch.
Else,
For each specified match process,
Execute GenericMatch in priority order.
Repeat until at least one invoice pay item was found or all
match processes have been executed.
GenericMatch
If match type is '1',
Set invoice document number (RPDOC) equal to
szGenericReferenceNumber.
Execute F03B11Match.
If match type is '2',
Set invoice sales order number (RPSDOC) equal to
szGenericReferenceNumber.
Execute F03B11Match.
If match type is '3',
Set invoice customer reference number (RPVR01) equal to
szGenericReferenceNumber.
Execute F03B11Match.
If match type is '4',
Execute F03B21Match.
If any invoice pay items were found,
Set cReturnMatchType.
F03B11Match
Open F03B11 table.
Set F03B11 selection using specified criteria.
While a record is found,
If the record already exists in the cache,
Skip record.
Else,
Increment mnTotalPayItems by one.
Accumulate mnTotalAmountOpen and mnTotalDiscountAvailable.
Add mnGracePeriodDays to invoice discount due date.
If jdDateGL is less than or equal to this calculated date,
Accumulate mnTotalDiscountEarnable.
Execute WriteCache.
Repeat until no more records remain.
Close F03B11 table.
F03B21Match
Open F03B11 table.
Open F03B21 table.
Set F03B21 selection using specified criteria.
While a record is found,
Retrieve corresponding F03B11 record.
If invoice pay item does not match the specified criteria,
Skip record.
Else,
If the record already exists in the cache,
Skip record.
Else,
Increment mnTotalPayItems by one.
Accumulate mnTotalAmountOpen and mnTotalDiscountAvailable.
Add mnGracePeriodDays to invoice discount due date.
If jdDateGL is less than or equal to this calculated date,
Accumulate mnTotalDiscountEarnable.
Execute WriteCache.
Repeat until no more records remain.
Close F03B11 table.
Close F03B21 table.
WriteCache
If mnCustomerAmountApplied is greater than zero,
If invoice open amount is greater than mnCustomerAmountApplied,
Set amount applied equal to mnCustomerAmountApplied.
Else,
Set amount applied equal to invoice open amount.
Subtract amount applied from invoice open amount and
mnCustomerAmountApplied.
If mnCustomerDiscountTaken is greater than zero,
If invoice discount available is greater than
mnCustomerDiscountTaken,
Set discount taken equal to mnCustomerDiscountTaken,
Else,
Set discount taken equal to invoice discount available.
Subtract discount taken from invoice discount available and
mnCustomerDiscountTaken.
If amount applied or discount taken is greater than zero,
Set user type input code equal to '10'.
Write record to the invoice selection cache.
D03B0169 - F03B11 Invoice Match Process
Purpose
This Data Structure is used for InvoiceMatchProcess function.
Parameters
Item DescriptionI/OReq?Notes
MATH01mnMatchLineIDIYLine number used to identify the results of the match.
GMFDszGenericReferenceNumberIYNumber used to match against invoices.
MAPRTcOverrideMatchTypeIYType of match to execute. Overrides the match order
specified on the processing options.
DCTszDocumentTypeINDocument Type of the Invoice. Used to filter invoices.
KCOszDocumentCompanyINDocument Key Company of the Invoice. Used to filter
invoices.
SFXszDocumentPayItemINDocument Pay Item of the Invoice. Used to filter
invoices.
PYRmnPayorNumberINPayor Number of the Invoice. Used to filter invoices.
AN8mnCustomerNumberINCustomer Number of the Invoice. Used to filter
invoices.
PA8mnParentNumberINParent Number of the Invoice. Used to filter invoices.
COszCompanyINCompany Number of the Invoice. Used to filter
invoices.
BCRCszBaseCurrencyIYRequired if currency is on. Company Base Currency
Code. Used to filter invoices.
CRRMcCurrencyModeIYRequired if currency is on. The mode specifies the
currency of the output amounts.
CRCDszTransactionCurrencyIYRequired if currency is on and the mode is foreign.
Used to filter invoices.
DGJjdDateGLIYTransaction's G/L Date. Determines whether a discount
is earnable or not.
PIDszProgramIDIYProgram ID of the calling program.
EV01cPayApprovedInvoicesOnlyIY1- Only select approved Invoices BLANK allow Held
Invoices to be selected.
GPDmnGracePeriodDaysIYGrace days to extended discount due date.
EV02cInvoiceMatchPriorityIYA value 1-4 priority to assigned to search Generic
Reference as a Invoice Number.
EV03cSalesOrderMatchPriorityIYA value 1-4 priority to assigned to search Generic
Reference as a Sales Order Number.
EV04cCustomerRefMatchPriorityIYA value 1-4 priority to assigned to search Generic
Reference as a Customer Reference.
EV05cStatementMatchPriorityIYA value 1-4 priority to assigned to search Generic
Reference as a Statement Number.
NINFDmnTotalPayItemsO Total number of Pay Items.
AAPmnTotalAmountOpenO Total open amount of found invoices.
ADSCmnTotalDiscountAvailableO Total discount available of found invoices.
EDSCmnTotalDiscountEarnableO Total discount earnable of found invoices.
EV06cReturnMatchTypeO Type of match that produced a successful search. This
value is blank if no invoices were found.
PAAPmnCustomerAmountAppliedINIf used, specifies how much to apply to the pay items
found.
ADSAmnCustomerDiscountTakenINIf used, specifies how much discount to take on the
pay items found.
TCRCszReceiptCurrencyCodeINRequired if Receipt is in alternate currency. Receipts
Currency Code.
CRRmnCurrencyConverRateOVINRequired if Receipt is in alternate currency. Exchange
Rate between receipt and invoice transaction.
CRR1mnTriangulationLeg1INRequired if Receipt is in alternate currency. Exchange
Rate Leg 1.
CRR2mnTriangulationLeg2INRequired if Receipt is in alternate currency. Exchange
Rate Leg 2.
CRCMcCurrencyConversionMethodINRequired if Receipt is in alternate currency. Currency
Conversion Method.
ERDJjdExchangeRateDateINRequired if Receipt is in alternate currency. Exchange
Date.
^
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
mnMatchLineID | MATH01 | MATH_NUMERIC | NONE | NONE |
- - - Good Performance Low Value. | ||||
szGenericReferenceNumber | GMFD | char | NONE | NONE |
An identification number that the system uses to locate invoice records for receipt matching. The system can locate invoices by the
| ||||
cOverrideMatchType | MAPRT | char | NONE | NONE |
A number that the system uses to identify which matching process to run to locate invoices. If you leave the field blank, the system uses the
| ||||
szDocumentType | DCT | char | NONE | NONE |
A user defined code (00/DT) that identifies the origin and purpose of the transaction. PeopleSoft reserves several prefixes for document
| ||||
szDocumentCompany | KCO | char | NONE | NONE |
A number that, with the document number, document type and G/L date, uniquely identifies an original document, such as invoice, voucher,
| ||||
szDocumentPayItem | SFX | char | NONE | NONE |
A number that identifies the pay item for a voucher or an invoice. The system assigns the pay item number. If the voucher or invoice has
| ||||
mnPayorNumber | PYR | MATH_NUMERIC | NONE | NONE |
The address book number of the person or company that sends the payment. | ||||
mnCustomerNumber | AN8 | MATH_NUMERIC | NONE | NONE |
A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or
| ||||
mnParentNumber | PA8 | MATH_NUMERIC | NONE | NONE |
The address book number of the parent company. The system uses this number to associate a particular address with a parent company
| ||||
szCompany | CO | char | NONE | NONE |
A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company
| ||||
szBaseCurrency | BCRC | char | NONE | NONE |
A code that represents the currency of the company for a transaction. For a foreign currency transaction, this is the currency code of the
| ||||
cCurrencyMode | CRRM | char | NONE | NONE |
An option that specifies whether the system displays amounts in the domestic or foreign currency.
On
The system displays amounts in the
| ||||
szTransactionCurrency | CRCD | char | NONE | NONE |
A code that identifies the currency of a transaction. | ||||
jdDateGL | DGJ | JDEDATE | NONE | NONE |
A date that identifies the financial period to which the transaction will be posted. You define financial periods for a date pattern code that you
| ||||
szProgramID | PID | char | NONE | NONE |
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry
| ||||
cPayApprovedInvoicesOnly | EV01 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
mnGracePeriodDays | GPD | MATH_NUMERIC | NONE | NONE |
A number that the system adds to the invoice due date to extend it for collection purposes. Generally, you specify the number of days
| ||||
cInvoiceMatchPriority | EV02 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
cSalesOrderMatchPriority | EV03 | char | NONE | NONE |
A radio button that specifies the level at which trace/track result is to be displayed. Select the Detail to display all transactions except IB, IX,
| ||||
cCustomerRefMatchPriority | EV04 | char | NONE | NONE |
PeopleSoft event point processing flag 04. | ||||
cStatementMatchPriority | EV05 | char | NONE | NONE |
A flag that indicates whether automatic spell check is turned on. | ||||
mnTotalPayItems | NINFD | MATH_NUMERIC | NONE | NONE |
The number of invoices that the system located based on the information provided on the remittance form. | ||||
mnTotalAmountOpen | AAP | MATH_NUMERIC | NONE | NONE |
The amount of an invoice or voucher pay item that is unpaid. | ||||
mnTotalDiscountAvailable | ADSC | MATH_NUMERIC | NONE | NONE |
The amount of the invoice or voucher pay item that is eligible to be subtracted from the gross amount when the transaction is paid. The
| ||||
mnTotalDiscountEarnable | EDSC | MATH_NUMERIC | NONE | NONE |
The amount of the discount that is taken on or before the discount due date. | ||||
cReturnMatchType | EV06 | char | NONE | NONE |
An option that specifies the type of processing for an event. | ||||
szReceiptCurrencyCode | TCRC | char | OPT | NONE |
A code that represents the currency of a receipt when it is different from the base currency of the company for which the receipt was entered. | ||||
mnCurrencyConverRateOv | CRR | MATH_NUMERIC | OPT | NONE |
A number (exchange rate) that a foreign currency amount is multiplied by to calculate a domestic currency amount.
The number in this field
| ||||
mnTriangulationLeg1 | CRR1 | MATH_NUMERIC | OPT | NONE |
The exchange rate from the foreign currency of the invoice to the triangulation currency (leg 1). This rate applies when you use triangulation
| ||||
mnTriangulationLeg2 | CRR2 | MATH_NUMERIC | OPT | NONE |
The exchange rate from the triangulation currency to the domestic currency (leg 2). This rate applies when you use triangulation to calculate
| ||||
cCurrencyConversionMethod | CRCM | char | OPT | NONE |
A value that specifies which method to use when converting from one currency to another. Valid values are:
Y
Multiplier method. The
| ||||
jdExchangeRateDate | ERDJ | JDEDATE | OPT | NONE |
The date that the system uses to retrieve the exchange rate from the Currency Exchange Rates table (F0015). | ||||
szUserTypeInputCode | UTIC | char | OPT | NONE |
A code that specifies how the system processes a transaction during receipts entry. The system will not process transactions with a blank
| ||||
mnReceiptSpotRate | CRR | MATH_NUMERIC | OPT | NONE |
A number (exchange rate) that a foreign currency amount is multiplied by to calculate a domestic currency amount.
The number in this field
| ||||
cShipmentNumberMatchPriority | EV07 | char | OPT | NONE |
An option that specifies the type of processing for an event. |
B0000027 CurrencyConvForAndDom | ||||
B03B0158 Maintain Receipts Entry Cache | ||||
B03B0172 Maintain Invoice Selection Cache |
F03B11 Customer Ledger | ||||
F03B21 A/R Notification History Detail |