Functional Description
This Business Function will Calculate the Domestic and Foreign Total for a contract when a line is cancelled.
Purpose
The purpose of this Business Function is to simplify the code in the P1721 as this calculation adds to complexity. It will calculate Domestic,
Foreign, for positive and negative contracts.
Setup Notes and Prerequisites
Before calling this Business function, verify that the line cancelled amount is not zero. With zero amounts, the Business function will not do perform
any calculations.
Special Logic
Technical Specification
VA evt_mnCreditCancelTotal_MATH01 = [BF mnDomesticCreditAmount]+[BF mnDomesticCancelAmount]
//
// ---------------------------------------------------------------------------
// POSITIVE CONTRACTS
// ---------------------------------------------------------------------------
If VA evt_mnCreditCancelTotal_MATH01 is greater than
//
// -Verify Dates/Amounts are within range
//
If BF jdCancelDate is equal to BF jdContractLineStartDate Or BF mnDomesticCancelAmount is greater than BF mnDomesticCreditAmount And
VA evt_mnCreditCancelTotal_MATH01 is less than BF mnDomesticLineTotal
BF mnDomesticContractTotal = ([BF mnDomesticContractTotal]-[BF mnDomesticCancelAmount])+[BF mnForeignCreditAmount]
If SL CurrencyProcessing is not equal to "N"
If BF szCurrencyCodeFrom is not equal to BF szCurrencyCodeOrigin
BF mnForeignContractTotal = ([BF mnForeignContractTotal]-[BF mnForeignCancelAmount])+[BF mnForeignCreditAmount]
End If
End If
Else
//
// -Full Line total amount needs to be cancelled
//
If VA evt_mnCreditCancelTotal_MATH01 is greater than BF mnDomesticLineTotal
BF mnDomesticContractTotal = ([BF mnDomesticContractTotal]-[BF mnDomesticLineTotal])+[BF mnDomesticCreditAmount]
If SL CurrencyProcessing is not equal to "N"
If BF szCurrencyCodeFrom is not equal to BF szCurrencyCodeOrigin
BF mnForeignContractTotal = ([BF mnForeignContractTotal]-[BF mnForeignLineTotal])+[BF mnForeignCreditAmount]
End If
End If
End If
End If
End If
// ---------------------------------------------------------------------------
//
// ---------------------------------------------------------------------------
// NEGATIVE CONTRACTS
// ---------------------------------------------------------------------------
If VA evt_mnCreditCancelTotal_MATH01 is less than
//
// -Verify Dates/Amounts are within range
//
If BF jdCancelDate is equal to BF jdContractLineStartDate Or BF mnDomesticCancelAmount is less than BF mnDomesticCreditAmount And VA
evt_mnCreditCancelTotal_MATH01 is greater than BF mnDomesticLineTotal
BF mnDomesticContractTotal = ([BF mnDomesticContractTotal]-[BF mnDomesticCancelAmount])+[BF mnForeignCreditAmount]
If SL CurrencyProcessing is not equal to "N"
If BF szCurrencyCodeFrom is not equal to BF szCurrencyCodeOrigin
BF mnForeignContractTotal = ([BF mnForeignContractTotal]-[BF mnForeignCancelAmount])+[BF mnForeignCreditAmount]
End If
End If
Else
//
// -Full Line total amount needs to be cancelled
//
If VA evt_mnCreditCancelTotal_MATH01 is less than BF mnDomesticLineTotal
BF mnDomesticContractTotal = ([BF mnDomesticContractTotal]-[BF mnDomesticLineTotal])+[BF mnDomesticCreditAmount]
If SL CurrencyProcessing is not equal to "N"
If BF szCurrencyCodeFrom is not equal to BF szCurrencyCodeOrigin
BF mnForeignContractTotal = ([BF mnForeignContractTotal]-[BF mnForeignLineTotal])+[BF mnForeignCreditAmount]
End If
End If
End If
End If
End If
// ---------------------------------------------------------------------------
D1702880 - Calculate Contract Cancelled Line
CSDTContract Line Start DateIYGC Contract Start
CNDJCancel DateIYGC Contract Cancel
AMTCDDomestic Credit AmountIYGC Credit
AMTCFForeign Credit AmountI YGC Credit F
CANDMDomestic Cancel AmountIYGC Cancel Amount
CANFNForeign Cancel AmountI YGC Cancel Amount F
TOTDDomestic Line TotalIYGC Line Total
FOAGForeign Line TotalIYGC Line Total F
TOTDDomestic Contract TotalI/OYFC Total
FOAGForeign Contract TotalI/OYFC Total F
CRCDCurrency Code FromIYFC Base Currency
CRCFCurrency Code BaseIYFC Customer Currency
MODEModeNReserved for Future Use
EV01Suppress ErrorsNReserved for Future Use
ERRCError CodeNReserved for Future Use
DTAIData Item (Error)NReserved for Future Use
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
jdContractLineStartDate | CSDT | JDEDATE | OPT | NONE |
The date you actually start work on the contract. | ||||
jdCancelDate | CNDJ | JDEDATE | OPT | NONE |
The date that the order should be canceled if the goods have not been sent to the customer or the goods have not been received from the
| ||||
mnDomesticCreditAmount | AMTCD | MATH_NUMERIC | OPT | NONE |
The monetary amount the customer has been credited for this order. The monetary amount is expressed in the currency that is set up for the
| ||||
mnForeignCreditAmount | AMTCF | MATH_NUMERIC | OPT | NONE |
The monetary amount that the customer has been credited for this order. The monetary amount is expressed in the currency that is set up
| ||||
mnDomesticCancelAmount | CANDM | MATH_NUMERIC | OPT | NONE |
The monetary amount that has been cancelled. The monetary amount is expressed in the currency that is set up for the company initiating
| ||||
mnForeignCancelAmount | CANFN | MATH_NUMERIC | OPT | NONE |
The monetary amount that has been cancelled. The monetary amount is expressed in the currency that is set up for the customer. | ||||
mnDomesticLineTotal | TOTD | MATH_NUMERIC | OPT | NONE |
Total dollars is a factor used to calculate average days to pay. The amount is equal to the sum of cash received against valid accounts
| ||||
mnForeignLineTotal | FOAG | MATH_NUMERIC | OPT | NONE |
When an adjustment is made to an invoice, the gross amount of the pay item before the adjustment. The foreign original gross amount is
| ||||
mnDomesticContractTotal | TOTD | MATH_NUMERIC | OPT | NONE |
Total dollars is a factor used to calculate average days to pay. The amount is equal to the sum of cash received against valid accounts
| ||||
mnForeignContractTotal | FOAG | MATH_NUMERIC | OPT | NONE |
When an adjustment is made to an invoice, the gross amount of the pay item before the adjustment. The foreign original gross amount is
| ||||
szCurrencyCodeOrigin | CRCF | char | OPT | NONE |
The currency code of the insured amount. | ||||
szCurrencyCodeFrom | CRCD | char | OPT | NONE |
A code that identifies the currency of a transaction. | ||||
cMode | MODE | char | OPT | NONE |
Reserved for Future Use | ||||
cSuppressErrors | EV01 | char | OPT | NONE |
Reserved for Future Use | ||||
cErrorCode | ERRC | char | OPT | NONE |
Reserved for Future Use | ||||
szDataItem | DTAI | char | OPT | NONE |
Reserved for Future Use |
None |
None |