project QadFinancials > class BDInvoice > method DefaultValuesCurrency
Description
Called when the Invoice Currency changes - defaults related fields
Parameters
icCurrencyCode | input | character | |
iiCurrencyId | input | integer | |
itDInvoicePostingDate | input | date | |
icOwnVatCurrencyCode | input | character | |
itDInvoiceTaxPointDate | input | date | |
odDInvoiceExchangeRate | output | decimal | |
odDInvoiceRateScale | output | decimal | |
odDInvoiceVatExchangeRate | output | decimal | |
odDInvoiceVatRateScale | output | decimal | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bdinvoice.p)
if icCurrencyCode = ?
then assign icCurrencyCode = "":U.
if icCurrencyCode = "":U
then return.
if icCurrencyCode = vcCompanyLC
then assign odDInvoiceExchangeRate = 1
odDInvoiceRateScale = 1.
else do:
<M-52 run GetExRateByEntityInvoiceFlag
(input itDInvoicePostingDate (itDInvoicePostingDate),
input itDInvoiceTaxPointDate (itDInvoiceTaxPointDate),
input iiCurrencyId (iiFromCurrencyId),
input icCurrencyCode (icFromCurrencyCode),
input viCompanyLCId (iiToCurrencyId),
input ? (icToCurrencyCode),
input ? (iiExchangeRateTypeId),
input {&EXCHANGERATETYPE-ACCOUNTING} (icExchangeRateTypeCode),
output odDInvoiceExchangeRate (odDInvoiceExchangeRate),
output odDInvoiceRateScale (odDInvoiceRateScale),
output viFcReturnSuper (oiReturnStatus)) in BDInvoice>
end.
<M-2 run DefaultValuesVatCurrency
(input icOwnVatCurrencyCode (icVatCurrencyCode),
input icCurrencyCode (icCurrencyCode),
input odDInvoiceExchangeRate (idDInvoiceExchangeRate),
input odDInvoiceRateScale (idDInvoiceRateScale),
input itDInvoiceTaxPointDate (itDInvoiceTaxPointDate),
output odDInvoiceVatExchangeRate (odDInvoiceVatExchangeRate),
output odDInvoiceVatRateScale (odDInvoiceVatRateScale),
output viFcReturnSuper (oiReturnStatus)) in BDInvoice>