| icDebtorCode | input | character | Debtor Code |
| icBillToDebtorCode | input | character | bill To Debtor Code |
| icDebtorTaxIDState | input | character | Debtor Tax ID State |
| icDebtorCountryCode | input | character | Country code of the debtor vat number |
| ilDebtorCountryIsEUCountry | input | logical | Is the debtor vat country an EU Country ? |
| ocDebtorVatNumber | output | character | Debtor Vat Number |
| ocDebtorVatCountryCode | output | character | Country code of the debtor vat number |
| olDebtorVatCountryIsEUCountry | output | logical | is the debtor vat country code an EU Country ? |
| oiReturnStatus | output | integer | Return status of the method. |
QadFinancials
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.