ReceiptsEntryReadCache

Receipts Entry Read Cache

Major Business Rule

Object Name: B03B0142

Parent DLL: CFIN

Location: Client/Server

Language: C

Functional Description

Purpose

This function is used to retrieve an invoice from the invoice selection cache. When this function is 
called, the next available cache record is read. The invoice detail is returned to the calling 

program.


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. Then a function to select invoice pay items and add 

them to the cache should be called. Any of the following functions can be used to add records to the 

cache: F03B11 Receipts Entry Load Invoices (B03B0143), F03B11 Load by Statement Number (B03B0152), F03B11 

Invoice Match Process (B03B0169), or Invoice Selection Write Cache (B03B0172). 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 delete records from the cache or check for records in the 

cache.


This function should be called once for each record in the cache using a loop structure. Before this 

function is called for the first time, set mnRecordsRemaining equal to the total number of records in 

the cache. Also, set idCacheCursorID equal to zero. Do not modify the value of these two parameters 

between executions of this function or unpredictable results will occur.


Special Logic

In order for this function to keep track of the next record to be read from the Invoice Selection 

cache, idCacheCursorID is used to store the cache cursor handle in memory between calls.



Technical Specification



Parameters

Item DescriptionI/OReq?Notes

MATH01mnRecordsRemainingI/OYNumber of records left to be read from the cache.
DOCmnDocumentNumberO

DCTszDocumentTypeO

KCOszDocumentCompanyO

SFXszDocumentPayItemO

AN8mnCustomerNumberO

COszCompanyO

GLCszReceivablesGLOffsetO

AIDszReceivablesAccountIDO

PYRmnPayorNumberO

AGmnAmountGrossO

AAPmnAmountOpenO

ADSCmnAmountDiscountAvailO

ADSAmnAmountDiscountTakenO

BCRCszBaseCurrencyO

CRRMcCurrencyModeO

CRCDszTransactionCurrencyO

CRRmnExchangeRateO

ACRmnAmountForeignGrossO

FAPmnAmountForeignOpenO

CDSmnAmountForeignDiscountAvailO

CDSAmnAmountForeignDiscountTakenO

MCUszBusinessUnitO

DDJjdDateDueO

DDNJjdDateDiscountDueO

SDOCmnSalesDocumentNumberO

SDCTszSalesDocumentTypeO

SKCOszSalesDocumentCompanyO

SFXOszSalesDocumentPayItemO

VR01szCustomerReferenceNumberO

RMKszRemarkO

GENLNGidCacheCursorIDI/OYA unique identifier used by this function to 

retrieve records from the cache.

UTICszUserTypeInputCodeO

PAAPmnCustomerAmountAppliedO

ADSAmnCustomerDiscountTakenO

DIVJjdDateInvoiceO

DGJjdDateGLO


Related Tables

F03B11Customer Ledger File


Related Functions

None.

Processing

If mnRecordsRemaining is less than or equal to zero,

Set error.

Else,

If idCacheCursorID is equal to zero,

Open Invoice Selection cache cursor.

Store cursor handle in memory.

Set idCacheCursorID.

Else,

Retrieve cursor handle from memory using idCacheCursorID.

Retrieve next record from the Invoice Selection cache.

Add record to the Receipts Entry cache.

Reduce mnRecordsRemaining by one.

Load invoice output parameters.

If mnRecordsRemaining is equal to zero,

Close the Invoice Selection cache cursor.

Free the cursor handle from memory.



^

Data Structure

D03B0142 - Receipts Entry Read Cache

Item DescriptionI/OReq?Notes

MATH01mnRecordsRemainingI/OYNumber of records left to be read from the cache.
DOCmnDocumentNumberO

DCTszDocumentTypeO

KCOszDocumentCompanyO

SFXszDocumentPayItemO

AN8mnCustomerNumberO

COszCompanyO

GLCszReceivablesGLOffsetO

AIDszReceivablesAccountIDO

PYRmnPayorNumberO

AGmnAmountGrossO

AAPmnAmountOpenO

ADSCmnAmountDiscountAvailO

ADSAmnAmountDiscountTakenO

BCRCszBaseCurrencyO

CRRMcCurrencyModeO

CRCDszTransactionCurrencyO

CRRmnExchangeRateO

ACRmnAmountForeignGrossO

FAPmnAmountForeignOpenO

CDSmnAmountForeignDiscountAvailO

CDSAmnAmountForeignDiscountTakenO

MCUszBusinessUnitO

DDJjdDateDueO

DDNJjdDateDiscountDueO

SDOCmnSalesDocumentNumberO

SDCTszSalesDocumentTypeO

SKCOszSalesDocumentCompanyO

SFXOszSalesDocumentPayItemO

VR01szCustomerReferenceNumberO

RMKszRemarkO

GENLNGidCacheCursorIDI/OYA unique identifier used by this function to 

retrieve records from the cache.

UTICszUserTypeInputCodeO

PAAPmnCustomerAmountAppliedO

ADSAmnCustomerDiscountTakenO

DIVJjdDateInvoiceO

DGJjdDateGLO


^

Parameter NameData ItemData TypeReq/OptI/O/Both
mnRecordsRemainingMATH01MATH_NUMERICNONENONE

Item  ab  Descriptionab  I/Oab  Req?ab Notes
MATH01ab  mnRecordsRemainingab  I/Oab  Yab Number of records left to be read from the cache.
ab  ab 


^

mnDocumentNumberDOCMATH_NUMERICNONENONE

A number that identifies the original document, such as a voucher, invoice, or journal entry. On entry forms, you can assign the document 
number or let the system assign it using the Next Numbers program (P0002). Matching document numbers (DOCM) identify related documents 
in the Accounts Receivable and Accounts Payable systems. Examples of original and matching documents are: Accounts Payable     o 
Original document - voucher     o Matching document - payment  Accounts Receivable     o Original document - invoice     o Matching document - 
receipt  Note: In the Accounts Receivable system, the following transactions simultaneously generate original and matching documents: 
deductions, unapplied receipts, chargebacks, and drafts.

szDocumentTypeDCTcharNONENONE

A user defined code (00/DT) that identifies the origin and purpose of the transaction.  PeopleSoft reserves several prefixes for document 
types, such as, vouchers, invoices, receipts, and timesheets. The reserved document type prefixes for codes are: P Accounts payable 
documents R Accounts receivable documents  T Time and Pay documents I Inventory documents  O Purchase order documents  S Sales order 
documents 

szDocumentCompanyKCOcharNONENONE

A number that, with the document number, document type and G/L date, uniquely identifies an original document, such as invoice, voucher, 
or journal entry. If you use the Next Numbers by Company/Fiscal Year feature, the Automatic Next Numbers program (X0010) uses the 
document company to retrieve the correct next number for that company. If two or more original documents have the same document number and 
document type, you can use the document company to locate the desired document.

szDocumentPayItemSFXcharNONENONE

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 
multiple pay items, the numbers are sequential.

mnCustomerNumberAN8MATH_NUMERICNONENONE

A number that identifies an entry in the Address Book system, such as employee, applicant, participant, customer, supplier, tenant, or 
location.

szCompanyCOcharNONENONE

A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company 
Constants table (F0010) and must identify a reporting entity that has a complete balance sheet. At this level, you can have intercompany 
transactions. Note: You can use company 00000 for default values such as dates and automatic accounting instructions. You cannot use company 00000 
for transaction entries.

szReceivablesGLOffsetGLCcharNONENONE

A code that determines the trade account that the system uses as the offset when you post invoices or vouchers. The system concatenates 
the value that you enter to the AAI item RC (for Accounts Receivable) or PC (for Accounts Payable) to locate the trade account. For 
example, if you enter TRAD, the system searches for the AAI item RCTRAD (for receivables) or PCTRAD (for payables).  You can assign up to four 
alphanumeric characters to represent the G/L offset or you can assign the three-character currency code (if you enter transactions in a 
multicurrency environment). You must, however, set up the corresponding AAI item for the system to use; otherwise, the system ignores the G/L 
offset and uses the account that is set up for PC or RC for the company specified.  If you set up a default value in the G/L Offset field of the 
customer or supplier record, the system uses the value during transaction entry unless you override it.  Note: Do not use code 9999. It is reserved for 
the post program and indicates that offsets should not be created.

szReceivablesAccountIDAIDcharNONENONE

A number that the system assigns to each general ledger account in the Account Master table (F0901) to uniquely identify it. 

mnPayorNumberPYRMATH_NUMERICNONENONE

The address book number of the person or company that sends the payment.

mnAmountGrossAGMATH_NUMERICNONENONE

A value that specifies the total amount of the invoice or voucher pay item. The gross amount might include the tax amount, depending on 
the tax explanation code. The system does not decrease the gross amount when payments are applied. When you void a transaction, the 
system clears the gross amount field.

mnAmountOpenAAPMATH_NUMERICNONENONE

The amount of an invoice or voucher pay item that is unpaid.

mnAmountDiscountAvailADSCMATH_NUMERICNONENONE

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 
system calculates discount amounts based on the payment term entered on the transaction.  Note: If the system calculates the discount, verify 
that it applies to the pay item specified. Usually, freight, sales tax, and labor charges that are included in the gross amount do not qualify for 
discounts.

mnAmountDiscountTakenADSAMATH_NUMERICNONENONE

The amount by which an invoice or voucher is reduced if paid by a specific date. The discount taken does not have to be the same as the 
discount available.

szBaseCurrencyBCRCcharNONENONE

A code that represents the currency of the company for a transaction. For a foreign currency transaction, this is the currency code of the 
domestic side of the transaction.

cCurrencyModeCRRMcharNONENONE

An option that specifies whether the system displays amounts in the domestic or foreign currency. On  The system displays amounts in the 
foreign currency of the transaction. Off  The system displays amounts in the domestic currency of the transaction.

szTransactionCurrencyCRCDcharNONENONE

A code that identifies the currency of a transaction. 

mnExchangeRateCRRMATH_NUMERICNONENONE

A number (exchange rate) that a foreign currency amount is multiplied by to calculate a domestic currency amount.  The number in this field 
can have a maximum of seven decimal positions. If more are entered, the system adjusts to the nearest seven decimal positions. 

mnAmountForeignGrossACRMATH_NUMERICNONENONE

The foreign currency amount entered on the transaction. If the Multi-Currency Conversion option on the General Accounting constants is set 
to Y, the foreign amount is multiplied by the exchange rate to arrive at the domestic amount. If the Multi-Currency Conversion option is set to Z, 
the foreign amount is divided by the exchange rate.

mnAmountForeignOpenFAPMATH_NUMERICNONENONE

The unpaid foreign amount of a transaction.

mnAmountForeignDiscountAvailCDSMATH_NUMERICNONENONE

The foreign amount of the discount available as opposed to the amount of the discount actually taken.

mnAmountForeignDiscountTakenCDSAMATH_NUMERICNONENONE

The amount of the discount, expressed in the foreign currency of the transaction, that was taken or granted during the application of a 
payment to an open invoice or voucher.

szBusinessUnitMCUcharNONENONE

An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit 
might be a warehouse location, job, project, work center, branch, or plant. You can assign a business unit to a document, entity, or person for 
purposes of responsibility reporting. For example, the system provides reports of open accounts payable and accounts receivable by 
business unit to track equipment by responsible department. Business unit security might prevent you from viewing information about business units 
for which you have no authority.

jdDateDueDDJJDEDATENONENONE

In Accounts Receivable, the date that the net payment is due. In Accounts Payable, the date that the payment is due to receive a discount 
or, if no discount is offered, the net due date. The system calculates the due date based on the payment term entered, or you can enter it 
manually. If you enter a negative voucher or invoice (debit or credit memo), the system might use the G/L date as the due date regardless of the 
payment term entered. A processing option in the master business function (P0400047 for vouchers and P03B0011 for invoices) controls how 
the system calculates the due date for debit and credit memos.

jdDateDiscountDueDDNJJDEDATENONENONE

In the Accounts Receivable system, the date that the invoice must be paid to receive the discount. The system calculates the discount due 
date based on the payment term. If the payment term does not specify a discount, the system completes this field with the net due date. In the 
Accounts Payable system, the date that the voucher is due.

mnSalesDocumentNumberSDOCMATH_NUMERICNONENONE

The number of the sales document

szSalesDocumentTypeSDCTcharNONENONE

Sales Document Type

szSalesDocumentCompanySKCOcharNONENONE

Document Company (Sales Order)

szSalesDocumentPayItemSFXOcharNONENONE

In the A/R and A/P systems, a code that corresponds to the pay item. In the Sales Order and Procurement systems, this code identifies 
multiple transactions for an original order. For purchase orders, the code is always 000. For sales orders with multiple partial receipts against an 
order, the first receiver used to record receipt has a suffix of 000, the next has a suffix of 001, the next 002, and so on.

szCustomerReferenceNumberVR01charNONENONE

An alphanumeric value used as a cross-reference or secondary reference number. Typically, this is the customer number, supplier 
number, or job number.

szRemarkRMKcharNONENONE

A generic field that you use for a remark, description, name, or address.

idCacheCursorIDGENLNGIDNONENONE

Item  ab  Descriptionab  I/Oab  Req?ab Notes
GENLNGab  idCacheCursorIDab  I/Oab  Yab A unique identifier used by this function to retrieve records 
from the cache.

 

^

szUserTypeInputCodeUTICcharNONENONE

A code that specifies how the system processes a transaction during receipts entry. The system will not process transactions with a blank 
or invalid type input.

mnCustomerAmountAppliedPAAPMATH_NUMERICNONENONE

In the Accounts Payable system, the amount of the payment. In the Accounts Receivable system, the amount of the receipt. This amount 
must balance to the total amount applied to the invoice pay items.

mnCustomerDiscountTakenADSAMATH_NUMERICNONENONE

The amount by which an invoice or voucher is reduced if paid by a specific date. The discount taken does not have to be the same as the 
discount available.

jdDateInvoiceDIVJJDEDATEOPTNONE

The date that either you or the system assigns to an invoice or voucher. This can be either the date of the supplier's invoice to you or the 
date of your invoice to the customer.

jdDateGLDGJJDEDATEOPTNONE

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 
assign to the company record. The system compares the date that you enter on the transaction to the fiscal date pattern assigned to the 
company to retrieve the appropriate fiscal period number, as well as to perform date validations.

jdInvoiceExchangeRateDateERDJJDEDATEOPTNONE

The date that the system uses to retrieve the exchange rate from the Currency Exchange Rates table (F0015). 

szTaxAreaTXA1charOPTNONE

A code that identifies a tax or geographic area that has common tax rates and tax authorities. The system validates the code you enter 
against the Tax Areas table (F4008). The system uses the tax rate area in conjunction with the tax explanation code and tax rules to calculate tax 
and G/L distribution amounts when you create an invoice or voucher.

szTaxExplanationCodeEXR1charOPTNONE

A hard-coded user defined code (00/EX) that controls the algorithm that the system uses to calculate tax and G/L distribution amounts. The 
system uses the tax explanation code in conjunction with the tax rate area and tax rules to determine how the tax is calculated. Each 
transaction pay item can be defined with a different tax explanation code.

mnItemNumberITMMATH_NUMERICOPTNONE

An inventory item number. The system provides three separate item numbers plus an extensive cross-reference capability to other item 
numbers (see data item XRT) to accommodate substitute item numbers, replacements, bar codes, customer numbers, supplier numbers, and 
so forth. The item numbers are as follows:   o Item Number (short) - An eight-digit, computer-assigned item number     o 2nd Item Number - The 
25-digit, free-form, user defined alphanumeric item number     o 3rd Item Number - Another 25-digit, free-form, user defined alphanumeric item 
number

mnShipmentNumberSHPNMATH_NUMERICOPTNONE

A "next number" that uniquely identifies a shipment.

Related Functions

None

Related Tables

F03B11 Customer Ledger