project QadFinancials > class BCInvoice > method CreateCIPostingGetShipTo

Description

Get the address information of the ship to address like TaxAddressId, TaxIDFeder, TaxIDSTate, TaxIDMisc1, TaxIDMisc2, TaxDeclaration


Parameters


iiShipToAddressIdinputintegerAddress of the ship to address
ocShipToTaxIDFederoutputcharacterTax ID Federal of ship to address
ocShipToTaxIDStateoutputcharacterTax ID State of ship to address
ocShipToTaxIDMisc1outputcharacterTax ID Misc1 of ship to address
ocShipToTaxIDMisc2outputcharacterTax ID Misc2 of ship to address
ocShipToTaxIDMisc3outputcharacterTax ID Misc3 of ship to address
oiShipToTaxDeclarationoutputintegerTax Declaration of Ship To
ocShipToTxzTaxZoneoutputcharactertax zone of the ship to address
olShipToCountryIsEUCountryoutputlogicalis the ship country an EU country or not ?
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCInvoice.CreateCIPosting


program code (program3/bcinvoice.p)

/* 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.