project QadFinancials > class BDInvoice > method DefaultValuesCurrency

Description

Called when the Invoice Currency changes - defaults related fields


Parameters


icCurrencyCodeinputcharacter
iiCurrencyIdinputinteger
itDInvoicePostingDateinputdate
icOwnVatCurrencyCodeinputcharacter
itDInvoiceTaxPointDateinputdate
odDInvoiceExchangeRateoutputdecimal
odDInvoiceRateScaleoutputdecimal
odDInvoiceVatExchangeRateoutputdecimal
odDInvoiceVatRateScaleoutputdecimal
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDInvoice.DefaultValuesDebtor
method BDInvoice.DefaultValuesPostingDate
method BDInvoice.DefaultValuesPostingYear
method BDInvoice.DefaultValuesTaxPointDate


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>