WriteStatisticalHistorytoCache

Write Statistical History to Cache

Major Business Rule

Object Name: B03B0123

Parent DLL: CFIN

Location: Client/Server

Language: C

B03B0123 
Write Statistical History to Cache


Functional Description

Purpose

This function will write cache records that contain F03B16S data.  If a record already exists for the 
key, AN8 and CO, the amounts will be added to the existing cache record.


Setup Notes and Prerequisites


Special Logic


Technical Specifications


Parameters

Data ItemDescriptionI/OReqNotes
AN8    mnAddressNumberIYes
CO     szCompanyIYes

DFIJ    jdDateFirstInvoiceJulianI

DLIJ    jdDateLastInvoiceJulianI

ALP    mnAmountLastPaidI

DLP    jdDateLastPaidI

MATH01 mnTotalNumberDaysLateI

ASTY   mnAmtInvoicedThisYrI

SPYE   mnAmtInvoicedPriorYrI

NXPD   jdNextPeriodToProcessI



Related Tables

F03B08Credit/Collection Date Pattern

jdeappApplications Global Definitions - include file only


Related Business Functions


Processing

• Set up CacheKey, szCompany, mnAddressNumber
• jdeCacheInit for F03B16SCache
• If jdeCacheGetNumRecords of F03B16SCache > 0
• jdeCacheOpenCursor on F03B16SCache
• jdeCacheFetchPositionForupdate on F03B16SCache
• If JDECM_PASSED
• Copy the input fields to the cache fields
• jdeCacheUpdate for F03B16SCache
• jdeCacheCloseCursor for F03B16SCache
• If Records Exists in Cache
• JDB_SetSelection to retrieve the next period to process on table F03B08 for the szCompany, and 
jdNextPeriodToProcess

• JDB_SelectKey on table F03B08
• If not JDEDB_PASSED
• JDB_SetSelection to retrieve the next period to process on table F03B08 for the szCompany 
'00000', and jdNextPeriodToProcess

• JDB_SelectKey on table F03B08
• JDB_Fetch on table F03B08
• Copy the input fields to the cache fields
• jdeCacheAdd for F03B16SCache
• Return ER_SUCCESS
^

Data Structure

D03B0123 - Write Statistical History to Cache

Parameter NameData ItemData TypeReq/OptI/O/Both
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.

mnAddressNumberAN8MATH_NUMERICNONENONE

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

jdDateFirstInvoiceJulianDFIJJDEDATENONENONE

The G/L date of the first invoice generated.

jdDateLastInvoiceJulianDLIJJDEDATENONENONE

The G/L date of the last invoice generated for the customer.

mnAmountLastPaidALPMATH_NUMERICNONENONE

The amount of the last payment applied to invoices based on the G/L date of the Receipt Detail record (F03B14). The system displays this 
information from either the A/R Statistical Summary table (F03B16S) or the A/R Statistical History table (F03B16), depending on the form. 
The system displays information from F03B16S on the Account Statistical Summary form and information from F03B16 on the Periodic Statistics 
form.

jdDateLastPaidDLPJDEDATENONENONE

The date of the last premium payment.

mnTotalNumberDaysLateMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

mnAmtInvoicedThisYrASTYMATH_NUMERICNONENONE

The amount invoiced for the year. The system uses the gross amount of the invoice record (F03B11) regardless of whether taxes are 
included. The system updates this field when you run the Statistics History Update program (R03B16). The system determines the current fiscal 
year from the Date Fiscal Patterns - 52 Period Accounting table (F0008B).

mnAmtInvoicedPriorYrSPYEMATH_NUMERICNONENONE

The gross amount invoiced for the previous year. The system updates this field only when you run the Statistics Annual Close program 
(R03B161). 

jdNextPeriodToProcessNXPDJDEDATENONENONE

The date that was entered for the Thru Date processing option on the Summary Record tab when the Statistics History Update program 
(R03B16) was run. The system uses this date to select and process records from the A/R Statistical History table (F03B16). 

Related Functions

None

Related Tables

F03B08 Credit/Collection Date Pattern