project QadFinancials > class BCInvoice > method DefaultValuesCurrency


Parameters


iiCompanyIDinputinteger
icCurrencyCodeinputcharacter
iiCurrencyIdinputinteger
itCInvoicePostingDateinputdate
icOwnVatCurrencyCodeinputcharacter
itCInvoiceTaxPointDateinputdate
itCInvoiceDateinputdate
odCInvoiceExchangeRateoutputdecimal
odCInvoiceRateScaleoutputdecimal
odCInvoiceVatExchangeRateoutputdecimal
odCInvoiceVatRateScaleoutputdecimal
odCInvoiceCCExchangeRateoutputdecimal
odCInvoiceCCRateScaleoutputdecimal
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCInvoice.DefaultValuesInvoiceDate
method BCInvoice.DefaultValuesPostingDate
method BCInvoice.DefaultValuesPostingYear
method BCInvoice.DefaultValuesSupplier


program code (program3/bcinvoice.p)

if icCurrencyCode = ?
then assign icCurrencyCode = "":U.

if icCurrencyCode = "":U
then return.

if icCurrencyCode = vcCompanyLC
then assign odCInvoiceExchangeRate = 1
            odCInvoiceRateScale    = 1.
else do:
    <M-6 run GetExRateByEntityInvoiceFlag
       (input  itCInvoiceDate (itCInvoiceDate), 
        input  itCInvoicePostingDate (itCInvoicePostingDate), 
        input  iiCurrencyId (iiFromCurrencyId), 
        input  icCurrencyCode (icFromCurrencyCode), 
        input  viCompanyLCId (iiToCurrencyId), 
        input  ? (icToCurrencyCode), 
        input  ? (iiExchangeRateTypeId), 
        input  {&EXCHANGERATETYPE-ACCOUNTING} (icExchangeRateTypeCode), 
        output odCInvoiceExchangeRate (odCInvoiceExchangeRate), 
        output odCInvoiceRateScale (odCInvoiceRateScale), 
        output viFcReturnSuper (oiReturnStatus)) in BCInvoice>
end.

if icCurrencyCode = vcCompanyCC
then assign odCInvoiceCCExchangeRate = 1
            odCInvoiceCCRateScale    = 1.
else do:
    <M-35 run GetExRateByEntityInvoiceFlag
       (input  itCInvoiceDate (itCInvoiceDate), 
        input  itCInvoicePostingDate (itCInvoicePostingDate), 
        input  iiCurrencyId (iiFromCurrencyId), 
        input  icCurrencyCode (icFromCurrencyCode), 
        input  viCompanyCCId (iiToCurrencyId), 
        input  ? (icToCurrencyCode), 
        input  ? (iiExchangeRateTypeId), 
        input  {&EXCHANGERATETYPE-STATUTORY} (icExchangeRateTypeCode), 
        output odCInvoiceCCExchangeRate (odCInvoiceExchangeRate), 
        output odCInvoiceCCRateScale (odCInvoiceRateScale), 
        output viFcReturnSuper (oiReturnStatus)) in BCInvoice>
end.

<M-3 run DefaultValuesVatCurrency
   (input  iiCompanyID (iiCompanyID), 
    input  icOwnVatCurrencyCode (icVatCurrencyCode), 
    input  icCurrencyCode (icCurrencyCode), 
    input  odCInvoiceExchangeRate (idCInvoiceExchangeRate), 
    input  odCInvoiceRateScale (idCInvoiceRateScale), 
    input  itCInvoiceTaxPointDate (itCInvoiceTaxPointDate), 
    output odCInvoiceVatExchangeRate (odCInvoiceVatExchangeRate), 
    output odCInvoiceVatRateScale (odCInvoiceVatRateScale), 
    output viFcReturnSuper (oiReturnStatus)) in BCInvoice>