CalculateTotalRevenue

Calculate Total Revenue

Minor Business Rule

Object Name: B1000009

Parent DLL: CALLBSFN

Location: Client/Server

Language: C

Functional Description

Purpose

Calculate total revenue. The calculated revenue amounts can be used as the basis of percent of 

revenue calculations. Total revenue is calculated for one level break above object account. If the UBE has 

level breaks of Business Unit, Object Account and Subisidiary Account, revenue will be calculated for 

each business unit before the business unit is processed. All accounts between the AAI's GLG6 and GLG7 

are the basis of total revenue. For each ledger type the following values are returned:

Current Month Total Revenue

Year to Date Total Revenue

Last Year Total Revenue Current Month

Last Years Year to Date Total Revenue

Setup Notes and Prerequisites

This function is designed to work only with tabular sections and to be executed on the before level 

break event.


The object and subsidiary accounts for GLG6 and GLG7 must be obtained prior to calling this function. 



You must pass the section Id of the tabular section that you wish to calculate total revenue for. To 

obtain the section Id find the UBE's application Id in Object Librarian. Open the Universal Table 

Browser and open Local Tam, open the file RDASPEC.DDB, search with the application Id in the column 

labeled IdReport. The record types of 2 are the sections in the UBE. Tabular sections are SectionType 46. 

Locate the section that is type 46 and pass its IdSection to this function in the parameter SectionId.


This function does not allocate memory to store the revenue amounts. You must pass the amounts back 

to the function each time it is called.


The parameter PreviouslyComputed is an indicator for all revenue accounts being processed or not. If 

PreviouslyComputed is a 'Y' all accounts between GLG6 and GLG7 have been processed and this function 

does not need to be called again. Pass this variable to the function each time it is called.


The Ledger Types can be passed or left blank. If both ledger type parameters are blank, the ledger 

type entered in data selection is used. If no ledger type is in data selection, all ledger types are 

added togather. 

Special Logic




Technical Specification

• Get the level breaks and sequence from the tablular section, determine the level break one above 
object account.

• Compare the previous value to the current value to determine if a level break is occuring.
• Get the data selection from the tablular section.
• Use this data selection to open the F0006, F0901 and F0902 tables.
• Select and accumulate all amounts between GLG6 and GLG7 for the given level break.
• Return total revenue.
'b7


Data Structure

D1000009 - Calculate Total Revenue

Parameter NameData ItemData TypeReq/OptI/O/Both
szObjectAccountGLG6OBJcharNONENONE

Special Input Expected
Object Account for GLG6 from the AAI's (F0012).



^

szSubsidiaryGLG6SUBcharNONENONE

Special Input Expected
The subsidiary account for GLG6 from the AAI's (F0012).





^

szObjectAccountGLG7OBJcharNONENONE

Special Input Expected
The object account for GLG7 from the AAI's (F0012).

^

szSubsidiaryGLG7SUBcharNONENONE

Special Input Expected
The subsidiary account for GLG7 from the AAI's (F0012).


^

mnPOPeriodNumberPNMATH_NUMERICNONENONE

Special Input Expected
The period number to process. Leave blank for the current financial reporting period from the F0010.

^

szPOFiscalYearFYOWcharNONENONE

Special Input Expected
The fiscal year to process in string format. Leave blank for the current financial reporting year 

from the F0010.

^

mnSectionIdMATH07MATH_NUMERICNONENONE

Special Input Expected
You must pass the section Id of the tabular section that you wish to calculate total revenue for. To 

obtain the section Id find the UBE's application Id in Object Librarian. Open the Universal Table 

Browser and open Local Tam, open the file RDASPEC.DDB, search with the application Id in the column 

labeled IdReport. The record types of 2 are the sections in the UBE. Tabular sections are SectionType 46. 

Locate the section that is type 46 and pass its IdSection to this function in the parameter SectionId.


^

mnCMTotalRevLT1AN01MATH_NUMERICNONENONE

Special Input Expected
Pass this parameter both ways or save the returned value after each call. 

^

mnYTDTotalRevLT1AN01MATH_NUMERICNONENONE

Special Input Expected
Pass this parameter both ways or save the returned value after each call.


^

mnCMLastYrTotalRevLT1AN01MATH_NUMERICNONENONE

Special Input Expected
Pass this parameter both ways or save the returned value after each call.


^

mnYTDLastYrTotalRevLT1AN01MATH_NUMERICNONENONE

Special Input Expected
Pass this parameter both ways or save the returned value after each call.


^

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.

szLedgerType1LTcharNONENONE

Special Input Expected
The Ledger Types can be passed or left blank. If both ledger type parameters are blank, the ledger 

type entered in data selection is used. If no ledger type is in data selection, all ledger types are 

added togather. 


^

szLedgerType2LTcharNONENONE

Special Input Expected
The Ledger Types can be passed or left blank. If both ledger type parameters are blank, the ledger 

type entered in data selection is used. If no ledger type is in data selection, all ledger types are 

added togather. 


^

mnCMTotalRevLT2AN01MATH_NUMERICNONENONE

A number that represents the net amount posted during the accounting period. The system uses the accounting periods from the Company 
Constants table (F0010). The net amount posted is the total of all debits and credits, beginning with the first day of the period through the last 
day of the period.

mnYTDTotalRevLT2AN01MATH_NUMERICNONENONE

A number that represents the net amount posted during the accounting period. The system uses the accounting periods from the Company 
Constants table (F0010). The net amount posted is the total of all debits and credits, beginning with the first day of the period through the last 
day of the period.

mnCMLastYrTotalRevLT2AN01MATH_NUMERICNONENONE

A number that represents the net amount posted during the accounting period. The system uses the accounting periods from the Company 
Constants table (F0010). The net amount posted is the total of all debits and credits, beginning with the first day of the period through the last 
day of the period.

mnYTDLastYrTotalRevLT2AN01MATH_NUMERICNONENONE

A number that represents the net amount posted during the accounting period. The system uses the accounting periods from the Company 
Constants table (F0010). The net amount posted is the total of all debits and credits, beginning with the first day of the period through the last 
day of the period.

cPreviouslyComputedEV01charNONENONE

Special Input Expected
Return this value to the function each time it is called.

Special Output Returned

'Y' = The total revenue has already been calculated for the current level break.


^

Related Functions

None

Related Tables

None