project QadFinancials > class BDInvoice > method GetDebtorVatNumber

Description

get all debtor vat number information


Parameters


icDebtorCodeinputcharacterDebtor Code
icBillToDebtorCodeinputcharacterbill To Debtor Code
icDebtorTaxIDStateinputcharacterDebtor Tax ID State
icDebtorCountryCodeinputcharacterCountry code of the debtor vat number
ilDebtorCountryIsEUCountryinputlogicalIs the debtor vat country an EU Country ?
ocDebtorVatNumberoutputcharacterDebtor Vat Number
ocDebtorVatCountryCodeoutputcharacterCountry code of the debtor vat number
olDebtorVatCountryIsEUCountryoutputlogicalis the debtor vat country code an EU Country ?
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDInvoice.CreateDInvoices
method BDInvoice.CreateFinChgInvoices


program code (program3/bdinvoice.p)

if icBillToDebtorCode = icDebtorCode or icBillToDebtorCode = ? or icBillToDebtorCode = "":U
then do: 
     assign ocDebtorVatNumber             = icDebtorTaxIDState
            ocDebtorVatCountryCode        = icDebtorCountryCode
            olDebtorVatCountryIsEUCountry = ilDebtorCountryIsEUCountry.
end.    
else do:
    <Q-1 run DebtorByDebtorIDCode (all) (Read) (NoCache)
       (input viCompanyId, (CompanyId)
        input ?, (DebtorId)
        input icBillToDebtorCode, (DebtorCode)
        input {&ADDRESSTYPECODESYSTEM-HEADOFFICE}, (AddressType)
        output dataset tqDebtorByDebtorIDCode) in BDebtor >
    find first tqDebtorByDebtorIDCode no-error.
    if available tqDebtorByDebtorIDCode
    then do:
        assign ocDebtorVatNumber             = tqDebtorByDebtorIDCode.tcDebtorTaxIDState
                    ocDebtorVatCountryCode        = tqDebtorByDebtorIDCode.tcCountryCode
                    olDebtorVatCountryIsEUCountry = tqDebtorByDebtorIDCode.tlCountryIsEUCountry.
    end.
end.