DetermineF4822PriorAmts

Determine Prior F4822 Amounts for Billing Line

Minor Business Rule

Object Name: N5200090

Parent DLL: CCRIN

Location: Client/Server

Language: NER

Determine Prior F4822 Amounts for Billing Line

Source Name:N5200090
Data Structure:
D5200090
Function Name:
DetermineF4822PriorAmts
System Code:52
Function Category:
BAT
Function Use:
INQ
Designer:
Ira Frosch
Programmer:
Ira Frosch

Revisions Log 

   Date   Modified bySAR NumberDescription
5 Aug 1999Ira Frosch3231605Creation


1.Functional Description

1.1Purpose
This business function retrieves the last application/adjustment created for a specified invoice line 
and returns the previous billed values.


1.2Setup Notes and Prerequisites

The current application and adjustment numbers can be entered if necessary.

1.3Special Logic

The program will find the last application number / adjustment number that has not been voided.  
However, if the Billing Type is Lump Sum, the prior billed amount for this period needs to be calculated 

by checking all records to determine if they are in the same period.


If the fiscal year is left blank, the system will determine the fiscal year, period number and 

century from the DGL parameter.  This is only performed if the billing line type is lump sum.


2.Technical Specifications


2.1Parameters:

See attachment for D5200090

2.2Related Tables 

TableTable Description
F4822Invoice Summary Work File (New Index Added (B))

2.3Related Business Functions

Source NameFunction Name
X0903ReturnFYPN


2.4Processing 

//
// Determine previous billing amount by checking the last application for this line

//

F4822.Open

//

// Select all records in table for this Billing Line (Application/Adjustment Descending)

//

F4822.Select (DOCO, DCTO, KCOO, COCH, LNID)

//

// Fetch while not EOF and not Voided

//

While not EOF and cRecordFound = ' '

F4822.FetchNext
//
If not EOF and not Void
If Application Number < BF App No 

OR Application Number = BF App No and Adjustment Number < BF Adj No

cRecordFound = '1'

//

// The previous amounts fetched do NOT include the current application amounts.  Add them together.

//

Endif
Endif

EndWhile

//

If cF4822Status = cOK

//

// Previous amounts have been set by the Fetch Next 

//

// However, if a LumpSum line, find all in the current period.

//

If BF cBillingType = 'L','3'
//

// Clear LS Values

//

If BF PN = 0

ReturnFYPN(BF DGL)

Endif

While cF4822Status = cOK
ReturnFYPN(evt_jdF4822DGL)

If evt_FY = BF FY and evt_PN = BF PN and evt_CTRY = BF CTRY
If szCurrentTaxArea <> '        '

mnLSPriorThisPeriodAmt = mnLSPriorThisPeriodAmt + ATXA

mnLSForPriorThisPeriodAmt = mnLSForPriorThisPeriodAmt + CTxA
Else

mnLSPriorThisPeriodAmt = mnLSPriorThisPeriodAmt + THPD
mnLSForPriorThisPeriodAmt = mnLSForPriorThisPeriodAmt + FHPD

Endif

F4822.Fetch Next
End While

Endif
Else

//

// Set all previous amounts = 0

//

Endif

//

F4822.Close


Data Structure

D5200090 - Determine Prior F4822 Amounts for Billing Line

D5200090
Determine Prior F4822 Amounts for Billing Line


2.1Parameters:


Data

Item Data Structure DescriptionI/OReq.Notes

DOCOmnContractNoIN

DCTOszContractDocumentTypeIN

KCOOszContractKeyCoIN

COCHszContractChangeOrderIN

LNIDszBillingLineIN

APPLmnApplicationNoIN

ADJNmnAdjustmentNoIN

PRTPcBillingTypeINIf 'L' or '3', calculate

mnPriorThisPeriodAmt and

mnForPriorThisPeriodAmt

DGLjdGLDateINFor Lump Sum calculation

CTRYmnCenturyI/ONFor Lump Sum calculation

FYmnFiscalYearI/ONFor Lump Sum calculation

PNmnPeriodNoI/ONFor Lump Sum calculation

PUHPmnPriorUnitsON

PTHPmnPriorInvTotalAmtON

PATXmnPriorInvTaxableAmtON

PTAMmnPriorTaxAmtON

PSMAmnPriorMiscInvAmtON

RTNPmnPriorRetAmtON

SMRPmnPriorMiscRetAmtON

ATXNmnPriorNonTaxableAmtON

FTHPmnForPriorInvTotalAmtON

FATXmnForPriorInvTaxableAmtON

FPTAmnForPriorTaxAmtON

FSMAmnForPriorMiscInvAmtON

FTNPmnForPriorRetAmtON

SMRFmnForPriorMiscRetAmtON

CTXNmnForPriorNotTaxableAmtON

THPDmnLSPriorThisPeriodAmtONFor Lump Sum calculation

FHPDmnLSForPriorThisPeriodAmtONFor Lump Sum calculation


Parameter NameData ItemData TypeReq/OptI/O/Both
mnContractNoDOCOMATH_NUMERICOPTNONE

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

szContractDocumentTypeDCTOcharOPTNONE

A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
reserved document type codes for vouchers, invoices, receipts, and time sheets, which create automatic offset entries during the post 
program. (These entries are not self-balancing when you originally enter them.) The following document types are defined by J.D. Edwards and 
should not be changed: P Accounts Payable documents   R Accounts Receivable documents   T Payroll documents   I Inventory documents  
O Purchase Order Processing documents   J General Accounting/Joint Interest Billing documents   S Sales Order Processing documents

szContractKeyCoKCOOcharOPTNONE

A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
sales order, and so on). If you use the Next Numbers by Company/Fiscal Year facility, the Automatic Next Numbers program (X0010) uses the 
order company to retrieve the correct next number for that company. If two or more order documents have the same order number and order 
type, the order company lets you locate the desired document. If you use the regular Next Numbers facility, the order company is not used to 
assign a next number. In this case, you probably would not use the order company to locate the document.

szContractChangeOrderCOCHcharOPTNONE

The change number of the contract. The change order number of the base contract is always initialized to 000. Each time you enter a 
change order for a contract, the system automatically increases the change order number by one. For example, the base contract is the change 
order number 000, the first change order is 001, the second is 002, and so on.

mnBillingLineNoLNIDMATH_NUMERICOPTNONE

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

mnApplicationNoAPPLMATH_NUMERICOPTNONE

The last or current application number for the specified contract. (The system assigns a new application number each time an invoice is 
issued for the contract.)

mnAdjustmentNoADJNMATH_NUMERICOPTNONE

A number used to control changes to closed applications. Closed applications represent invoices that have been sent. This number is 
always zero unless you reopen a previous application.

cBillingTypePRTPcharOPTNONE

A code that specifies the billing terms that are defined by the billing line on the contract. The system uses the predefined codes for the 
pricing type to access formulas and other information related to the calculation of billing and revenue amounts for the billing line. Valid alphabetic 
codes are: B Burden T Time and Materials U Unit Price L Lump Sum F Fee Line C Component M Milestone P Progress D Direct Draw R Rated 
Draw Valid numeric codes are: 0 Burden 1 Time and Materials 2 Unit Price 3 Lump Sum 4 Fee Line 5 Component 6 Milestone 7 Progress 8 Direct 
Draw 9 Rated Draw

jdGLDateDGLJDEDATEOPTNONE

A date that identifies the financial period to which the transaction is to be posted.  The company constants specify the date range for each 
financial period. You can have as many as 14 periods. Generally, period 14 is used for audit adjustments. The system validates this field for 
PBCO (posted before cutoff), PYEB (prior year ending balance), PACO (post after cutoff), and WACO (post way after cutoff) messages.

mnCenturyCTRYMATH_NUMERICOPTNONE

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_NUMERICOPTNONE

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_NUMERICOPTNONE

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.

mnPriorUnitsPUHPMATH_NUMERICOPTNONE

The units previously billed this period for the line item on the contract.

mnPriorInvTotalAmtPTHPMATH_NUMERICOPTNONE

The amount previously billed this period for the line item on the contract.

mnPriorInvTaxableAmtPATXMATH_NUMERICOPTNONE


mnPriorTaxAmtPTAMMATH_NUMERICOPTNONE

The tax amount previously billed for the billing line on the contract.

mnPriorStoredMatInvAmtPSMAMATH_NUMERICOPTNONE

The amount previously billed for Stored Material for the line item on the contract.

mnPriorRetAmtRTNPMATH_NUMERICOPTNONE

Retainage Amount through the last application or adjustment for a specific contract.

mnPriorStoredMatRetAmtSMRPMATH_NUMERICOPTNONE

The prior retained amount for the stored materials.

mnPriorNonTaxableAmtATXNMATH_NUMERICOPTNONE


mnForPriorInvTotalAmtFTHPMATH_NUMERICOPTNONE

The amount previously billed this period for the line item on the contract.

mnForPriorInvTaxableAmtFATXMATH_NUMERICOPTNONE


mnForPriorTaxAmtFPTAMATH_NUMERICOPTNONE

The foreign tax amount previously billed for the billing line on the contract.

mnForPriorStoredMatInvAmtFSMAMATH_NUMERICOPTNONE

The amount previously billed for Stored Material for the line item on the contract.

mnForPriorRetAmtFTNPMATH_NUMERICOPTNONE

Retainage Amount through the last application or adjustment for a specific contract.

mnForPriorNonTaxableAmtCTXNMATH_NUMERICOPTNONE


mnLumpSumPriorThisPeriodAmtTHPDMATH_NUMERICOPTNONE

The amount that is being billed for this contract pay item.

mnLumpSumForPriorThisPeriodAmtFHPDMATH_NUMERICOPTNONE

The amount that is being billed for this contract pay item. On entry screens,you can enter this amount one of three ways:     o A Dollar 
Amount.     o A Percent Complete. Enter a percent sign % before or after the percent complete amount. For example, you can enter 10% complete as 
%10 or 10%.        The system calculates this amount as the Schedule of Values minus prior payments.     o Number of Units. Enter a forward 
slash / before or after the number of units. For example, you can enter 10 units as /10 or 10/. The system calculates this amount as the number 
of units multiplied by the unit rate. You must have a unit rate payment type and a valid unit price for the contract pay item in order to use this 
entry method.

mnForPriorStoredMatRetAmtSMPFMATH_NUMERICOPTNONE

Related Functions

None

Related Tables

None
DetermineF4822PriorCost

DetermineF4822PriorCost

Determine Prior F4822 Amounts for Billing Line

Minor Business Rule

Object Name: N5200090

Parent DLL: CCRIN

Location: Client/Server

Language: NER

Determine F4822 Prior Cost for Time and Material

Source Name:
N5200090
Data Structure: 
D5200090A
Function Name:DetermineF4822PriorCost

System Code:52 (Contract Billing)
Function Use
GET (Data Retrieval)
Designer:
Falah Thamir
Programmer:
Falah Thamir


Revisions Log 
  Date  Modified bySAR NumberDescription
13 Oct, 1999F. Thamir3303189Create



1.Functional Description

1.1
Purpose

This business function calculates the total cost amount (domestic and foreign) from F4822 for Time 

and Material billing line records.

 

1.2Setup Notes and Prerequisites


All input data structure parameters must be entered.


1.3Special Logic


2.Technical Specifications


2.1Parameters:


See attachment under D5200090A


2.2Related Tables 

Table Table Description
F4822Invoice Summary Workfile



2.3Related Business Functions

Source NameFunction Name



2.4Processing 


// Initialize Information
Zero accumulators for AA and ACR (domestic and foreign amounts)

//

// F4822.Select (DOCO=, DCTO=, KCOO=, APPL >=, COCH=, LNID=) (use index Contract No, 

while not EndOfFile (F4822)

F4822.FetchNext (ADJN, APPO, VOID, AA, ACR)

if VOID = blank or null

if F4822_APPO = "P"

if (F4822_APPL < BF AAPL) or (APPL = BF APPL && F4822_ADJN < BF ADJN)

Accumulate AA & ACR

endif

endif

endwhile

//

if no records found

then

BF cErrorCode = 1

else

cErrorCode = blank
copy the total of AA & ACR into BF

endif

Data Structure

D5200090A - Determine F4822 Prior Cost for Time and Material

D5200090A
Determine F4822 Prior Cost for Time and Material


Parameters:


Data

Item Data StructureI/OReq.Notes

DOCOmnContractNoIY

DCTOszContractDocTypeIY

KCOOszContractKeyCoIY

COCHszContractChgOrderIY

LNIDmnContractLineNoIY

APPLmnApplicationNoIY

ADJNmnAdjustmentNoIY

AAmnCostAmtO

ACRmnForCostAmtO

EV01mnErrorCodeOblank = no errors

1 = no records found

Parameter NameData ItemData TypeReq/OptI/O/Both
mnContractNo_DOCODOCOMATH_NUMERICREQINPUT

A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry, 
and so on.

szContractDocType_DCTODCTOcharREQINPUT

A user defined code (00/DT) that identifies the type of document. This code also indicates the origin of the transaction. J.D. Edwards has 
reserved document type codes for vouchers, invoices, receipts, and time sheets, which create automatic offset entries during the post 
program. (These entries are not self-balancing when you originally enter them.) The following document types are defined by J.D. Edwards and 
should not be changed: P Accounts Payable documents   R Accounts Receivable documents   T Payroll documents   I Inventory documents  
O Purchase Order Processing documents   J General Accounting/Joint Interest Billing documents   S Sales Order Processing documents

szContractKeyCo_KCOOKCOOcharREQINPUT

A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a 
sales order, and so on). If you use the Next Numbers by Company/Fiscal Year facility, the Automatic Next Numbers program (X0010) uses the 
order company to retrieve the correct next number for that company. If two or more order documents have the same order number and order 
type, the order company lets you locate the desired document. If you use the regular Next Numbers facility, the order company is not used to 
assign a next number. In this case, you probably would not use the order company to locate the document.

szContractChgOrder_COCHCOCHcharREQINPUT

The change number of the contract. The change order number of the base contract is always initialized to 000. Each time you enter a 
change order for a contract, the system automatically increases the change order number by one. For example, the base contract is the change 
order number 000, the first change order is 001, the second is 002, and so on.

mnContractLineNo_LNIDLNIDMATH_NUMERICREQINPUT

A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns 
this number,but in some cases you can override it.

mnApplicationNo_APPLAPPLMATH_NUMERICREQINPUT

The last or current application number for the specified contract. (The system assigns a new application number each time an invoice is 
issued for the contract.)

mnAdjustmentNo_ADJNADJNMATH_NUMERICREQINPUT

A number used to control changes to closed applications. Closed applications represent invoices that have been sent. This number is 
always zero unless you reopen a previous application.

mnCostAmt_AAAAMATH_NUMERICOPTOUTPUT

A number that identifies the amount that the system will add to the account balance of the associated account number.  Enter credits with a 
minus sign (-) either before or after the amount. 

mnForCostAmt_ACRACRMATH_NUMERICOPTOUTPUT

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.

cErrorCode_EV01EV01charOPTOUTPUT

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

Related Functions

None

Related Tables

None