project QadFinancials > class BDInvoice > method CreateDIPostingGetShipFrom

Description

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


Parameters


iiShipFromAddressIdinputintegerAddress Id of ship from address (address of customer)
ocShipFromTaxIDFederoutputcharacterTax ID federal of the ship from address
ocShipFromTaxIDStateoutputcharacterTax ID State of the ship from address
ocShipFromTaxIdMisc1outputcharacterTax ID Misc1 of the ship from address
ocShipFromTaxIdMisc2outputcharacterTax ID Misc2 of the ship from address
ocShipFromTaxIdMisc3outputcharacterTax ID Misc3 of the ship from address
oiShipFromTaxDeclarationoutputintegerTax declaration of the ship from address
ocShipFromTaxZoneoutputcharacterTax Zone of the ship from address
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BDInvoice.CreateDIPosting


program code (program3/bdinvoice.p)

/* replace unknown values */
if iiShipFromAddressId = ? then assign iiShipFromAddressId = 0.

if iiShipFromAddressId <> 0
then do:
    <Q-1 run AddressByIDMinimal (all) (Read) (NoCache)
       (input iiShipFromAddressId, (AddressID)
        output dataset tqAddressByIDMinimal) in BBusinessRelation >
    find first tqAddressByIDMinimal where
               tqAddressByIDMinimal.tiAddress_ID = iiShipFromAddressId
               no-lock no-error.
    if available tqAddressByIDMinimal
    then assign ocShipFromTaxIDFeder     = tqAddressByIDMinimal.tcAddressTaxIDFederal
                ocShipFromTaxIDState     = tqAddressByIDMinimal.tcAddressTaxIDState
                ocShipFromTaxIDMisc1     = tqAddressByIDMinimal.tcAddressTaxIDMisc1
                ocShipFromTaxIDMisc2     = tqAddressByIDMinimal.tcAddressTaxIDMisc2
                ocShipFromTaxIDMisc3     = tqAddressByIDMinimal.tcAddressTaxIDMisc3
                oiShipFromTaxDeclaration = tqAddressByIDMinimal.tiAddressTaxDeclaration
                ocShipFromTaxZone        = tqAddressByIDMinimal.tcTxzTaxZone.
end.