| ilShipToCountryIsEUCountry | input | logical | Is the country an EU country for ship to |
| icShipToAddressTaxIdState | input | character | Tax Id State for the ship to address |
| icShipToCountryCode | input | character | country code of the ship to address |
| ocOwnVatNumber | output | character | Own Vat Number |
| ocOwnVatCountryCode | output | character | Own Vat Country Code |
| ocOwnVatCurrencyCode | output | character | Own Vat Currency Code |
| oiReturnStatus | output | integer | Return status of the method. |
QadFinancials
if ilShipToCountryIsEUCountry
then do:
assign ocOwnVatNumber = icShipToAddressTaxIdState
ocOwnVatCountryCode = icShipToCountryCode.
/* CEE VAT Currency ================ */
/* Default Vat declaration currency */
/* ================================= */
if icShipToCountryCode <> ? and
icShipToCountryCode <> "":U
then do:
<Q-1 run CountryByCountry (all) (Read) (NoCache)
(input ?, (CountryId)
input icShipToCountryCode, (CountryCode)
output dataset tqCountryByCountry) in BCountry >
find first tqCountryByCountry where
tqCountryByCountry.tcCountryCode = icShipToCountryCode
no-error.
if available tqCountryByCountry
then assign ocOwnVatCurrencyCode = tqCountryByCountry.tcCurrencyCode.
end.
end.