iiShipToAddressId | input | integer | Address of the ship to address |
ocShipToTaxIDFeder | output | character | Tax ID Federal of ship to address |
ocShipToTaxIDState | output | character | Tax ID State of ship to address |
ocShipToTaxIDMisc1 | output | character | Tax ID Misc1 of ship to address |
ocShipToTaxIDMisc2 | output | character | Tax ID Misc2 of ship to address |
ocShipToTaxIDMisc3 | output | character | Tax ID Misc3 of ship to address |
oiShipToTaxDeclaration | output | integer | Tax Declaration of Ship To |
ocShipToTxzTaxZone | output | character | tax zone of the ship to address |
olShipToCountryIsEUCountry | output | logical | is the ship country an EU country or not ? |
oiReturnStatus | output | integer | Return status of the method. |
/* replace unknown values */ if iiShipToAddressId = ? then assign iiShipToAddressId = 0. if iiShipToAddressId <> 0 then do: <Q-2 run AddressByIDMinimal (all) (Read) (NoCache) (input iiShipToAddressId, (AddressID) output dataset tqAddressByIDMinimal) in BBusinessRelation > find first tqAddressByIDMinimal where tqAddressByIDMinimal.tiAddress_ID = iiShipToAddressId no-lock no-error. if available tqAddressByIDMinimal then do: assign ocShipToTaxIDFeder = tqAddressByIDMinimal.tcAddressTaxIDFederal ocShipToTaxIDState = tqAddressByIDMinimal.tcAddressTaxIDState ocShipToTaxIDMisc1 = tqAddressByIDMinimal.tcAddressTaxIDMisc1 ocShipToTaxIDMisc2 = tqAddressByIDMinimal.tcAddressTaxIDMisc2 ocShipToTaxIDMisc3 = tqAddressByIDMinimal.tcAddressTaxIDMisc3 oiShipToTaxDeclaration = tqAddressByIDMinimal.tiAddressTaxDeclaration ocShipToTxzTaxZone = tqAddressByIDMinimal.tcTxzTaxZone. if tqAddressByIDMinimal.tiCountry_ID <> ? and tqAddressByIDMinimal.tiCountry_ID <> 0 then do: <Q-3 run CountryByIDAllInfo (all) (Read) (NoCache) (input tqAddressByIDMinimal.tiCountry_ID, (Country_ID) output dataset tqCountryByIDAllInfo) in BCountry > find first tqCountryByIDAllInfo where tqCountryByIDAllInfo.tiCountry_ID = tqAddressByIDMinimal.tiCountry_ID no-error. assign olShipToCountryIsEUCountry = if available tqCountryByIDAllInfo then tqCountryByIDAllInfo.tlCountryIsEUCountry else ?. end. end. end.