project QadFinancials > class BVAT > method GetTaxEnvironment

Description

Get the tax environment


Parameters


ilStartAndOpenPGTMinputlogical
icShipFromTaxZoneinputcharacterTax Zone of the Ship From
icShipToTaxZoneinputcharacterTax Zone of the Ship to
icTxclTaxClsinputcharacterTax Class
ocTxenvTaxEnvoutputcharacterTax Environment
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BCInvoice.DefaultValuesTaxEnv
method BDInvoice.DefaultValuesTaxEnv
method BJournalEntry.DefaultTaxEnvironment
method BVAT.GetTaxEnvAndCalculateTaxByItemClass
method BVAT.GetTaxEnvironmentAndCalculateTax


program code (program7/bvat.p)

assign oiReturnStatus = -98.

/* Replace unknown values */
if icShipFromTaxZone = ?
then assign icShipFromTaxZone = "":U.

if icShipToTaxZone = ?
then assign icShipToTaxZone = "":U.

if icTxclTaxCls = ?
then assign icTxclTaxCls = "":U.

if ilStartAndOpenPGTM
then do:
    <I-1 {bFcStartAndOpenInstance
         &CLASS              = "PGTM"}>
end.

<M-5 run GetTaxEnvironmentByParam
   (input  icShipFromTaxZone (icFromTaxZoneCode), 
    input  icShipToTaxZone (icToTaxZone), 
    input  icTxclTaxCls (icTaxClassCode), 
    output ocTxenvTaxEnv (ocTaxEnvCode), 
    output viFcReturnSuper (oiReturnStatus)) in PGTM>

if viFcReturnSuper < 0 or
   oiReturnStatus  = -98
then assign oiReturnStatus = viFcReturnSuper.

if ilStartAndOpenPGTM
then do:
    <I-6 {bFcCloseAndStopInstance
         &CLASS           = "PGTM"}>
end.

if oiReturnStatus = -98
then assign oiReturnStatus = 0.