Process Time And Material Billing Line For Contract Billing Invoice
Source Name:N5200204
Data Structure: D5200204
Function Name:ProcTimeMatBillLineForCBInvoice
System Code:52 (Contract Billing)
Function Category:BAT (Batch)
Function Use:UPD (Add/Update)
Designer:Ira Frosch
Programmer:Falah Thamir
Revisions Log
Date Modified bySAR NumberDescription
13 Oct, 1999F Thamir3303189Create
1.Functional Description
1.1Purpose
This business function will perform the processing to update/create records for a Time and Material billing line.
1.2Setup Notes and Prerequisites
The invoice number and pay item (Data Dictionary Item SFX) should be pre-determined.
1.3Special Logic
This business function will evaluate all F4812 records for the system. If there are no records that exactly match the search criteria, the system will
create a Default Invoice workfile record for the Time and Material line. Reads will be from the F4812 table.
If Invoice Number (DOCZ) = 0 then keys used in F4812.Select are DOCO, DCTO, KCOO, COCH, & OPIM;
else the keys will be same as above plus DOCZ, DCTI, & KCOI. Also, when DOCZ not zero, the historical fields in F4812 (HOTL, HOTX, & HTAM)
will not be updated.
If the information from the F5201/F5202 is not passed in, the system will retrieve it during the creation of the Default Invoice line.
2.Technical Specifications
2.1Parameters: See list in attachment for D5200204
2.2Related Tables
Table Table Description
F4812Billing Workfile
2.3Related Business Functions
Source NameFunction Name
N48S0200Calculate Billing Amount
N5200200Create CB Default Workfile Record
2.4Processing
// Verify that there is a detail record for a T & M/component line which is not in
// an active batch.
// If there isn't one, create a record with zero billing amt.
// This will be used for printing the pay item on the invoice.
//
// Initialize Information
evt_cRecordFound = ' '
evt_cOK = ' '
evt_cEOF = '1'
evt_cErrorStatus= ' '
evt_cF4812Status= ' '
evt_cValidF4812Record = ' '
//
// Clear All Return Amount Values
//
//
// Select F4812 records based on billing line information
//
if DOCZ = 0
elseF4812.Select (DOCO,DCTO,KCOO,COCH,LNID, DOCZ, DCTI, KCOI )
//
// If OK, continue
//
While evt_cF4812Status = cOK and cErrorStatus = ' '
//
// Read ALL variables in
//
F4812.FetchNext (using index Contract Number, Cntr Type, +)
//
// If OK, then continue
//
If evt_cF4812Status = cOK
evt_cValidF4812Record = '1'
//
// Check 1. Eligibility Code must be Invoice and Revenue ('0') or Invoice only ('1')
//Transaction Class must not be Automatic ('A') or Revenue Placeholder 'B')
//
If evt_cF4812EligibilityCode_ELGC <> '0','1'
Or evt_cF4812TransactionClass_TCLS = 'A', 'B'
evt_cValidF4812Record = ' '
Endif
//
// Check 2.Cutoff Dates - If Table Basis Date is less than From Date And From Date <> 0
//Or Table Basis Date is greater than Thru Date And Thru Date <> 0
//Record is not valid
//
If evt_jdF4812TableBasisDate_TBDT < BF jdDateBillFrom And BF jdDateBillFrom <> 0
Or evt_jdF4812TableBasisDate_TBDT > BF jdDateBillThru And BF jdDateBillThru <> 0
evt_cValidF4812Record = ' '
Endif
//
// Check 3.Hold Codes -If Invoice Hold Code is on (i.e., = 'A', 'B', 'I', '1', '2', or '3')
//If Release Date is 0
//Or Release Date Greater than Bill Thru Date and Bill Thru Date <> 0
//Or Release Date Less than Bill From Date and Bill From Date <> 0
//Record is not valid
//
If evt_cF4812HoldCode = 'A', 'B', 'I', '1', '2', '3'
If evt_jdF4812ReleaseDate = 0
Or BF jdDateBillThru <> 0
And evt_jdF4812ReleaseDate > BF jdDateBillThru
Or BF jdDateBillFrom <> 0
And evt_jdF4812ReleaseDate < BF jdDateBillFrom
evt_cValidF4812Record = ' '
Else
//
//Release the record by clearing the hold
//
Endif
Endif
//
// If all tests pass, mark that at least one record was found (so no Default Billing line is created)
//
If evt_cValidF4812Record = '1'
evt_cRecordFound = '1'
//
if szF4812_TXA1 <> BF TXA1
or szF4812EXR1 <> BF EXR1
szF4812TXA1= BF TXA1
szF4812EXR1= BF EXR1
if BF VertexActive = "1,Y"
Clear F4812/ CITX, ITAM, CITL, ITOL which will be recalculated by N48S0200
// Call N48S0200 to recalculate taxes, totals, & historical amounts
//
If DOCZ = 0
else F4812.Update (excluding historical fields)
//Both update statements use index Billing, Cntl ID, G/L Date, +, Primary, Unique)
//
// Increment Total Amounts for this Billing Line to Return
//
// AA, ITOL, ITAM, ITXA, JTAX, IDSC, AA2, CITL, CITX, CITA, JTXF, CIDS
//
//Transaction Class = '1' signifies Labor lines - accumulate total
If evt_cF4812TransactionClass_TCLS = '1'
//
//Accumulate ITOL and CITL (to be returned in BF TLAB and BF FLAB)
Endif
//
// Transaction Class = '2' signifies Burden lines - accumulate total
//
If evt_cF4812TransactionClass_TCLS = '2'
//
// Accumulate ITOL and CITL (to be returned in BF TBUR and BF FBUR)
Endif
//
//Accumulate Roll Units if parameter is on
//
If BF cRollUnits_ROLU = '1'
And evt_szF4812UnitOfMeasure_UM = BF szUnitOfMeasure_UM
BF mnUnits = BF mnUnits + evt_mnF4812Units
endif
//
// Endif (Valid F4812 record)
Endif (F4812 read correctly)
End while (F4812 read loop)
//
// If no record found, write Default Invoice workfile record with 0 amount
//
If evt_cRecordFound = ' '
//
// Call external procedure for write
//
Call CreateCBDefaultInvoiceWorkfileRecord (N5200200)
else
Return accumulated values to output parameters
Endif
BF cErrorCode = evt_cErrorStatus
D5200204 - Process Time And Material Billing Line For CB Invoice
D5200204
Process Time And Material Billing Line For Contract Billing Invoice
Parameters
Data
Item Data StructureI/OReq.Notes
DOCOmnContractNoIY
DCTOszContractDocumentTypeIY
KCOOszContractKeyCoIY
COCHszContractChangeOrderIY
LNIDmnContractLineNoIY
ICUmnBatchNoIY
DTFRjdDateBillFromIYIf zero, the system will process
all records before the Thru Date
DTTOjdDateBillThruIYIf zero, the system will process
all records in the workfile and
will disregard DTFR
APDTjdApplicationDateIY
DGJjdGeneralLedgerDateIY
DSVJjdServiceDateIY
ERDBcExchangeRateDateBasisIY
ERRCcErrorCodeOblank = no errors
1 = no records found in F4812
2 = Error 1 and error returned by
N5200200
3 = Error returned by N48S0200
DOCZmnInvoiceNoIY
DCTIszInvoiceDocumentTypeIY
KCOIszInvoiceKeyCompany IY
SFXszPayItemIYThis is the pay item of the billing
line on the invoice.
CRCDszBaseCurrencyIIf multicurrency is on, this field
is required.
CRCFszForeignCurrencyIIf multicurrency is on, this field is
required.
CRRMcCurrencyModeIIf multicurrency is on, this field
is required. This is the mode
from the contract.
CRRDmnCurrencyRateI/OIf multicurrency is on, this field
is required. This is the rate
calculated for this date.
AN8OmnCustomerNumberI
DL01szBillingLineDescripI
OPIMszBillingLineI
PRTPcBillingLineTypeI
MCUSszProjectNoIRequired for Default Invoice record.
Should be from F5202 table.
EXR1szTaxExplanationCodeI
TXA1szTaxRateAreaI
PCTNszParentContractNoI
PCTTszParentContractTypeI
PCKOszParentContractKeyCoI
JMCUszHostBusinessUnitIYUsed to determine the RP12 from the
Business Unit Master (From F5201)
Required when calling N5200200.
When DOCZ not 0, can enter blank
because N5200200 will not be called
because records in F4812 should be
found.
ACCOcAccountOverIDetermines whether to set override
revenue account
MCUszBusinessUnitIBusiness Unit from F5202
OBJszObjectINeeded only for override revenue
account
SUBszSubsidiaryINeeded only for override revenue
account
SBLszSubledgerI
SBLTszSubledgerTypeI
ROLUcRollUnitsFlagI
UMszUnitOfMeasureIOnly for Roll Units = '1'
TBDTjdTableBasisDateIY
COszCompanyIY
PTCszPaymentTermsI
EV01cVertexActiveIRequired for Vertex
JOBSmnVertexJobNumberIRequired for Vertex
PIDszCallingProgramIdI
UmnUnitsO
AAmnCostAmtO
ITOLmnInvoiceTotalAmtO
ITAMmnInvoiceTaxAmtO
ITXAmnInvoiceTaxableAmtO
JTAXmnJournalledTaxO
IDSCmnDiscountAmtO
TLABmnTotalAmtLaborO
TBURmnTotalAmtBurdenO
AA2mnCostAmtFO
CITLmnForInvTotalAmtO
CITXmnForInvTaxAmtO
CITAmnForInvTaxableAmtO
JTXFmnForJrnlTaxAmtO
CIDSmnForInvDiscountAmtO
FLABmnForTotLaborAmtO
FBURmnForTotBurdenAmtO
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
mnContractNo_DOCO | DOCO | MATH_NUMERIC | REQ | INPUT |
A number that identifies an original document. This document can be a voucher, a sales order, an invoice, unapplied cash, a journal entry,
| ||||
szContractDocumentType_DCTO | DCTO | char | REQ | INPUT |
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
| ||||
szContractKeyCo_KCOO | KCOO | char | REQ | INPUT |
A number that, along with order number and order type, uniquely identifies an order document (such as a purchase order, a contract, a
| ||||
szContractChangeOrder_COCH | COCH | char | REQ | INPUT |
The change number of the contract. The change order number of the base contract is always initialized to 000. Each time you enter a
| ||||
mnContractLineNo_LNID | LNID | MATH_NUMERIC | REQ | INPUT |
A number that identifies multiple occurrences, such as line numbers on a purchase order or other document. Generally, the system assigns
| ||||
mnBatchNo_ICU | ICU | MATH_NUMERIC | REQ | INPUT |
A number that identifies a group of transactions that the system processes and balances as a unit. When you enter a batch, you can either
| ||||
jdDateBillFrom_DTFR | DTFR | JDEDATE | OPT | INPUT |
The beginning date for which the transaction or code is applicable. | ||||
jdDateBillThru_DTTO | DTTO | JDEDATE | OPT | INPUT |
The ending date for which the transaction or code is applicable. | ||||
jdApplicatnDate_APDT | APDT | JDEDATE | REQ | INPUT |
The date of the last or current application. (An application is assigned each time an invoice is issued for the contract.) | ||||
jdGeneralLedgerDate_DGJ | DGJ | JDEDATE | REQ | INPUT |
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
| ||||
jdServiceDate_DSVJ | DSVJ | JDEDATE | REQ | INPUT |
A date that indicates when you purchased goods or services, or when you incurred a tax liability. | ||||
cExchangeRateDateBasis_ERDB | ERDB | char | REQ | INPUT |
A code that controls which date the system uses to retrieve the exchange rate for the invoice. Valid values are:
1
Use the invoice date
| ||||
cErrorCode_ERRC | ERRC | char | OPT | OUTPUT |
This error code indicates if any errors occurred during the creation of the Trip Document Detail (F4914) records by the Delivery Document
| ||||
mnInvoiceNo_DOCZ | DOCZ | MATH_NUMERIC | REQ | INPUT |
The original document number. This can be a voucher, an invoice, unapplied cash, a journal entry number, etc. Matching document
| ||||
szInvoiceDocumentType_DCTI | DCTI | char | REQ | INPUT |
A user defined (00/DI) document type for invoice entry. Any document type set up for invoice-only entry should begin with the letter R
| ||||
szInvoiceKeyCompany_KCOI | KCOI | char | REQ | INPUT |
Invoice Document Company. | ||||
szPayItem_SFX | SFX | char | REQ | INPUT |
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
| ||||
szBaseCurrency_CRCD | CRCD | char | OPT | INPUT |
A code that identifies the currency of a transaction. | ||||
szForeignCurrency_CRCF | CRCF | char | OPT | INPUT |
The currency code of the insured amount. | ||||
cCurrencyMode_CRRM | CRRM | char | OPT | INPUT |
An option that specifies whether the system displays amounts in the domestic or foreign currency.
On
The system displays amounts in the
| ||||
mnCurrencyRate_CRRD | CRRD | MATH_NUMERIC | OPT | BOTH |
A number (exchange rate) that a foreign currency amount is divided by to calculate a domestic currency amount. The number you enter in
| ||||
mnCustomerNumber_AN8O | AN8O | MATH_NUMERIC | OPT | INPUT |
The address book number to which the system posts billing and accounts receivable transactions. | ||||
szBillingLineDescription_DL01 | DL01 | char | OPT | INPUT |
A user defined name or remark. | ||||
szBillingLine_OPIM | OPIM | char | OPT | INPUT |
The pay item number as defined by the owner. This field is alphanumeric and can be up to 15 characters in length. It is recommended that
| ||||
cBillingLineType_PRTP | PRTP | char | OPT | INPUT |
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
| ||||
szProjectNo_MCUS | MCUS | char | OPT | INPUT |
Either a subsequent business unit or a project number.
A subsequent business unit specifies where to charge costs (or revenues) when the
| ||||
szTaxExplanationCode_EXR1 | EXR1 | char | OPT | INPUT |
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
| ||||
szTaxRateArea_TXA1 | TXA1 | char | OPT | INPUT |
A code that identifies a tax or geographic area that has common tax rates and tax authorities. The system validates the code you enter
| ||||
mnParentContractNo_PCTN | PCTN | MATH_NUMERIC | OPT | INPUT |
The parent contract number to which this particular contract is attached. | ||||
szParentContractType_PCTT | PCTT | char | OPT | INPUT |
The parent contract type to which this particular contract is attached. | ||||
szParentContractKeyCo_PCKO | PCKO | char | OPT | INPUT |
Parent Contract Document Company. | ||||
szHostBusinessUnit_JMCU | JMCU | char | REQ | INPUT |
The Business Unit responsible for the job. This is particularly useful during transfer pricing. | ||||
cAccountOver_ACCO | ACCO | char | OPT | INPUT |
An option that specifies whether the account information for a billing line identifies a revenue or cost (source) account. The system
| ||||
szBusinessUnit_MCU | MCU | char | OPT | INPUT |
An alphanumeric code that identifies a separate entity within a business for which you want to track costs. For example, a business unit
| ||||
szObject_OBJ | OBJ | char | OPT | INPUT |
The portion of a general ledger account that refers to the division of the Cost Code (for example, labor, materials, and equipment) into
| ||||
szSubsidiary_SUB | SUB | char | OPT | INPUT |
A subset of an object account. Subsidiary accounts include detailed records of the accounting activity for an object account. | ||||
szSubledger_SBL | SBL | char | OPT | INPUT |
A code that identifies a detailed, auxiliary account within a general ledger account. A subledger can be an equipment item number or an
| ||||
cSubledgerType_SBLT | SBLT | char | OPT | INPUT |
A user defined code (00/ST) that is used with the Subledger field to identify the subledger type and how the system performs subledger
| ||||
cRollUnitsFlag_ROLU | ROLU | char | OPT | INPUT |
This is a flag for Time and Material items to tell the system whether or not to roll the sum of the detail workfile (F4812) units into the summary
| ||||
szUnitOfMeasure_UM | UM | char | OPT | INPUT |
A user defined code (00/UM) that identifies the unit of measurement for an amount or quantity. For example, it can represent a barrel, box,
| ||||
jdTableBasisDate_TBDT | TBDT | JDEDATE | REQ | INPUT |
This date is used as the basis for comparison to the effective dates of the various tables used by the Service Billing system. This date is
| ||||
szCompany_CO | CO | char | REQ | INPUT |
A code that identifies a specific organization, fund, or other reporting entity. The company code must already exist in the Company
| ||||
szPaymentTerms_PTC | PTC | char | OPT | INPUT |
A code that specifies the terms of payment, including the percentage of discount available if the invoice is paid by the discount due date.
| ||||
cVertexActive_EV01 | EV01 | char | OPT | INPUT |
An option that specifies the type of processing for an event. | ||||
mnVertexJobNumber_JOBS | JOBS | MATH_NUMERIC | OPT | INPUT |
The job number (work station ID) which executed the particular job. | ||||
szCallingProgramId_PID | PID | char | OPT | INPUT |
The number that identifies the batch or interactive program (batch or interactive object). For example, the number of the Sales Order Entry
| ||||
mnUnits_U | U | MATH_NUMERIC | OPT | OUTPUT |
The quantity of something that is identified by a unit of measure. For example, it can be the number of barrels, boxes, cubic yards, gallons,
| ||||
mnCostAmt_AA | AA | MATH_NUMERIC | OPT | OUTPUT |
A number that identifies the amount that the system will add to the account balance of the associated account number. Enter credits with a
| ||||
mnInvTotalAmt_ITOL | ITOL | MATH_NUMERIC | OPT | OUTPUT |
The invoice amount for a billing detail transaction. | ||||
mnInvTaxAmt_ITAM | ITAM | MATH_NUMERIC | OPT | OUTPUT |
The tax amount in the invoice. This can be either the sales, use or VAT tax. | ||||
mnInvTaxableAmt_ITXA | ITXA | MATH_NUMERIC | OPT | OUTPUT |
The portion of the invoice amount that is subject to tax. | ||||
mnJrnlTaxAmt_JTAX | JTAX | MATH_NUMERIC | OPT | OUTPUT |
The portion of the tax amount calculated for this entry that is not automatically generated by the post program. | ||||
mnInvDiscountAmt_IDSC | IDSC | MATH_NUMERIC | OPT | OUTPUT |
The amount of the discount available, as opposed to the amount of the discount actually taken. The discount calculated is based on the
| ||||
mnTotalLaborAmt_TLAB | TLAB | MATH_NUMERIC | OPT | OUTPUT |
The total labor amount of the invoice or bill. | ||||
mnTotalBurdenAmt_TBUR | TBUR | MATH_NUMERIC | OPT | OUTPUT |
The total burden amount of the invoice or bill. | ||||
mnCostAmtF_AA2 | AA2 | MATH_NUMERIC | OPT | OUTPUT |
Amount. | ||||
mnForInvTotalAmt_CITL | CITL | MATH_NUMERIC | OPT | OUTPUT |
The total amount of the invoice in foreign currency. | ||||
mnForInvTaxAmt_CITX | CITX | MATH_NUMERIC | OPT | OUTPUT |
The tax amount on the invoice in foreign currency. This can be either the sales, use or VAT tax. | ||||
mnForInvTaxableAmt_CITA | CITA | MATH_NUMERIC | OPT | OUTPUT |
The portion of the foreign invoice amount that is subject to tax. | ||||
mnForJrnlTaxAmt_JTXF | JTXF | MATH_NUMERIC | OPT | OUTPUT |
The portion of the tax amount calculated for this entry that is not automatically generated by the post program. | ||||
mnForInvDiscountAmt_CIDS | CIDS | MATH_NUMERIC | OPT | OUTPUT |
The foreign currency amount of the discount available, as opposed to the amount of the discount actually taken. The discount calculated is
| ||||
mnForTotLaborAmt_FLAB | FLAB | MATH_NUMERIC | OPT | OUTPUT |
The total labor foreign amount of the invoice or bill. | ||||
mnForTotBurdenAmt_FBUR | FBUR | MATH_NUMERIC | OPT | OUTPUT |
The total burden foreign amount of the invoice or bill. | ||||
szGlClass | GLC | char | OPT | INPUT |
A code that determines the trade account that the system uses as the offset when you post invoices or vouchers. The system concatenates
| ||||
szGlOffsetRetention | RGLC | char | OPT | INPUT |
A code that designates the offset accounts for retainage, for example RETN or 1225. You set up the code as an automatic accounting
| ||||
szVertexTransactionType | VVTY | char | OPT | INPUT |
Vertex Sales and Use Tax transaction type. | ||||
szVertexProductCategory | VVTC | char | OPT | INPUT |
User defined code used in the Vertex Tax Decision Maker for products or services that are non-taxable or are at a non-stanard rate. | ||||
cPTCOverride_EV01 | EV01 | char | OPT | INPUT |
An option that specifies the type of processing for an event. |
None |
None |