F03b16BalanceStatsHist

F03b16BalanceStatsHist

Major Business Rule

Object Name: B03B0075

Parent DLL: CFIN

Location: Client/Server

Language: C

B03B0075 
F03B16 Balance Stats History


Functional Description


Purpose
This business function will update balance and statistical information in the Account Statistical 
History file (F03B16) and the Account Statistic Summary file (F03B16S).


Setup Notes and Prerequisites

This should be called immediately after the Update Statistic History UBE (R03B16) has completed.

Special Logic

This business function should only select records out of the F03B16 that have the Net Change Amount 
(CHGA) set to a value not equal to 0. The AN8 and CO parameters are optional. If sent then only F03B16 

records for that AN8 and CO should be processed.


Technical Specifications

Parameters

ItemDescriptionI/OReq?Notes
AN8 Customer NumberICustomer to be processed.
CO Company NumberICompany to be processed.

EV01 DSO MethodIReqDSO Method.

MATH01 DSO PeriodsIReqPeriods to include in DSO calc.

CTRY mnCenturyI

FY mnFiscalYearI

PN mnPeriodNoI


Related Tables

F03B16Account Statistic History
F03B16SAccount Statistic Summary

F03B08Credit/Collection Date Pattern


Related Business Functions

B03B0042Retrieve Company Constants - Aging
B03B0137F03B11 As Of Aging Summary

B9800100Get Audit Information
N03B0135F03012 Retrieve Credit and Collection Manager

JDEAPPApplications Global Definitions - include file only


Processing

While Fetch on RBAL is Successful
   SetSelection F03B16 (RBAL <> 0)

   SelectKeyed

   Fetch F03B16 returning AN8, CO, FY, PN and RBAL

   SetSelection F03B16 (AN8, CO, FY >=, PN >=)

   SelectKeyed

   While Fetch F03B16

      If RBAL = 2 <== Meaning that this is a new F03B16 record.

         Call Subroutine to fetch Previous ending balance.  Returning Prev Ending Balance

         ENBL =  prev periods ENBL + Change Amount

         Move '1' to RBAL field

      Else

         ENBL = current ENBL + Change Amount

      End If

      Move ENBL to Previous Ending Balance

      Move '1' to RBAL field

      Update F03B16 record

      Write Record to Cache

      Fetch Next F03B16

   End While

End While


Subroutine

SetSelection F03B16 (AN8, CO, FY <, PN <)
SelectKeyed

Fetch F03B16 returning FY, PN and ENBL

If SUCCESS

   Return Ending Balance = ENBL

   Call Subroutine Determine if there is a gap in periods

   Retrieve F03B08 Record on FY and Company and return to array

   If Not Successful and CO <> '00000'

      Retrieve F03B08 Record on FY and Zero Company and return to array

   End If


   If Successful Fetch

      If FY of Subroutine record = FY of the main processing record

         counter = Subroutine period

         While Continue

            Counter + 1

            If Array[counter].Period = Main Record Period

               End Loop

            Else

               If Array[counter].Period <> 0

                  ENBL = Previous ENBL

                  Write F03B16 Record

                  Write Record to Cache

               End If

            End If

         End While

   Else

      Retrieve F03B08 Record on Subroutine FY and Company and return to array

      If Not Successful and CO <> '00000'

         Retrieve F03B08 Record on Subroutine FY and Zero Company and return to array

      End If

      If Successful Fetch

         counter = Subroutine period

         While Continue

            Counter + 1

            If Array[counter].Period <> 0

               ENBL = Previous ENBL

               Write F03B16 Record

               Write Record to Cache

            Else

               If Main Record Period = 1

                  End Loop

               Else

                  Counter2 = 0

                  While Counter2 <> Main Record Period

                     Counter2 + 1

                     ENBL = Previous ENBL

                     Write F03B16 Record

                     Write Record to Cache

                  End While

               End If

            End If

         End While

      Else

         ERROR

      End If

   Else

      ERROR

   End If

Else

   Return Ending Balance = 0

End If



^

Data Structure

D03B0075 - F03B16BalanceStatsHist

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

cDSOMethodEV01charNONENONE

An option that specifies the type of processing for an event.

mnDSOPeriodsMATH01MATH_NUMERICNONENONE

- - - Good Performance Low Value. 

mnCenturyCTRYMATH_NUMERICNONENONE

The calendar century associated with the year. Enter is the first two digits of the year. For example, 19 indicates any year beginning with 19 
(1998, 1999), 20 indicates any year beginning with 20 (2000, 2001), and so on.

mnFiscalYearFYMATH_NUMERICNONENONE

A number that identifies the fiscal year. Generally, you can either enter a number in this field or leave it blank to indicate the current fiscal 
year (as defined on the Company Setup form). Specify the year at the end of the first period rather than the year at the end of the fiscal period. 
For example, a fiscal year begins October 1, 1998 and ends September 30, 1999. The end of the first period is October 31, 1998. Specify the 
year 98 rather than 99.

mnPeriodNoPNMATH_NUMERICNONENONE

A number indicating the current accounting period.  This number, used in conjunction with the Company Constants table (F0010) and the 
General Constants table (F0009), allows the user to define up to 14 accounting periods. See General Ledger Date.  The current period number 
is used to determine posted before and posted after cut off warning messages.  It is also used as the default accounting period in the 
preparation of financial reports.

Related Functions

B03B0042 Retrieve Company Constants - Aging
B03B0137 F03B11 As Of Aging Summary
B9800100 Get Audit Information

Related Tables

F03B16 A/R Statistical History
F03B16S A/R Statistical Summary