project QadFinancials > class BPosting > method AddPostingLineTaxValAndDef

Description

AddPostingLineTaxValAndDef: submethod of AddPostingLineTax: validations and defaulting of the parameters


Parameters


bcPostingTcRowidinput-outputcharacterThe tc_rowid of the posting your want a new posting-line for
btTaxPointDateinput-outputdatetax point date of the posting-line
bcPostingLineTextinput-outputcharacterPosting-line-text
bcCurrencyCodeinput-outputcharacterCurrency Code of the posting-line that will be created
bcPostingVatInOutinput-outputcharacterIndicates the direction of the taxes: for supplier invoices this will normaly be the incomming direction.
Use proprocessors: VATINOUT
icPostingVatCodeinputcharacter
icPostingVatDomaininputcharacter
bdExchangeRateinput-outputdecimalExchange Rate of the posting-line that will be created.
This is the rate information between TC and LC
bdExchangeRateScaleinput-outputdecimalExchange Rate Scale of the posting-line that will be created.
This is the rate information between TC and LC
bcExchangeRateTypeinput-outputcharacterType of the exchange rate of the posting-line that will be created.
This is the rate information between TC and LC
bcTransactionTypeinput-outputcharacterTransaction-Type: corresponds with field PostingVat.PostingVatTransType.
Use following preprocessores to fill this parameter: VATTRANSACTIONTYPES
bcTaxTransactionTypeinput-outputcharacterTax-Transaction-Type: corresponds with no specific field in the posting but is used to determine some other information.
Pass following preprocessors for this parameter:
VATTAXTRANSACTIONTYPES
bdBaseDebitTCinput-outputdecimalBase-Debit -amount in TC of the posting-line that will be created
bdBaseCreditTCinput-outputdecimalBase-Credit-amount in TC of the posting-line that will be created
bdBaseDebitLCinput-outputdecimalBase-Debit -amount in LC of the posting-line that will be created
bdBaseCreditLCinput-outputdecimalBase-Credit-amount in LC of the posting-line that will be created
bdBaseDebitCCinput-outputdecimalBase-Debit-amount in CC of the posting-line that will be created
bdBaseCreditCCinput-outputdecimalBase-Credit-amount in CC of the posting-line that will be created
bdVatDebitTCinput-outputdecimalVat-Debit-amount in TC of the posting-line that will be created
bdVatCreditTCinput-outputdecimalVat-Credit-amount in TC of the posting-line that will be created
bdVatDebitLCinput-outputdecimalVat-Debit-amount in LC of the posting-line that will be created
bdVatCreditLCinput-outputdecimalVat-Credit-amount in LC of the posting-line that will be created
bdVatDebitCCinput-outputdecimalVat-Debit-amount in CC of the posting-line that will be created
bdVatCreditCCinput-outputdecimalVat-Credit-amount in CC of the posting-line that will be created
bcNormalTaxGLCodeinput-outputcharacterGL-code of the posting-line that will be created
bcNormalTaxDivisionCodeinput-outputcharacterDivision-code of the posting-line that will be created
blNormalTaxIsAlreadyAbsRetinput-outputlogicalNormalTaxIsAlreadyAbsRet: set to true in case the posting-line and posting-vat identified by icNormalTaxGLCode concerns an absorbed or retained tax.
If this parameter is true then icAbsRetTaxGLCode should be empty
bcAbsRetTaxGLCodeinput-outputcharacterGL-Code that will be used for the tax-postingline that covers the absorbed or retained taxes
bcAbsRetTaxDivisionCodeinput-outputcharacterDivisionCode that will be used for the tax-postingline that covers the absorbed or retained taxes
bcFromTaxZoneinput-outputcharacterFrom Tax Zone
bcToTaxZoneinput-outputcharacterTo Tax Zone
bcTaxEnvrionmentinput-outputcharacterTax Environment
blIsTaxableinput-outputlogicalIs Taxable flag
bcTaxClassinput-outputcharacterTax Class
bcTaxUsageinput-outputcharacterTax Usage
bcTaxTypeinput-outputcharacterTax Type
iiTaxAddressIDinputintegerShip From Address ID in case of purchasing: this paramater is not indeed if the next 5 parameters about the Tax are specified.
If this field is filled, then the next 5 parameters are not taken into account.
bcTaxIDFederinput-outputcharacterTaxIDFeder of the TaxAddress
bcTaxIDStateinput-outputcharacterState of the TaxAddress
bcTaxIDMisc1input-outputcharacterMisc1 of the TaxAddress
bcTaxIDMisc2input-outputcharacterMisc2 of the TaxAddress
bcTaxIDMisc3input-outputcharacterMisc3 of the TaxAddress
iiOwnAddressIDinputintegerShip To Address ID (address of our own company) in case of purchasing: this parameter is not indeed if the next 6 parameters about the Own-address are specified.
If this field is filled, then the next 6 parameters are not taken into account.
bcOwnTaxIDFederinput-outputcharacterOwnTaxIDFeder: Feder of the own address
bcOwnTaxIDStateinput-outputcharacterOwnTaxIDState: State of the own address
bcOwnTaxIDMisc1input-outputcharacterOwnTaxIDMisc1: Misc1 of the own address
bcOwnTaxIDMisc2input-outputcharacterOwnTaxIDMisc2: Misc2 of the own address
bcOwnTaxIDMisc3input-outputcharacterOwnTaxIDMisc3: Misc3 of the own address
biOwnTaxIDDeclaratinput-outputintegerOwnTaxIDDeclarat: Declarat of the own address
blIsSuspDelinput-outputlogicalilIsSuspDel: Is the tax marked as Suspended or Delayed tax
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BPosting.AddPostingLineTax


program code (program6/bposting.p)

/* ================== */
/* Exception handling */
/* ================== */    
assign oiReturnStatus       = -98
       viLocalReturnStatus  = 0.
    
/* ================== */
/* Exception handling */
/* ================== */    
VALIDATIONSBLOCK:  DO :
      
    /* =============================================== */
    /* Replace unknown values and do some defaulting   */
    /* Check for errors as well                        */
    /* =============================================== */
    if bcPostingTcRowid             = ? then assign bcPostingtcRowid            = "":U.
    if bcPostingLineText            = ? then assign bcPostingLineText           = "":U.
    if bdBaseDebitTC                = ? then assign bdBaseDebitTC               = 0.
    if bdBaseCreditTC               = ? then assign bdBaseCreditTC              = 0.
    if bdBaseDebitLC                = ? then assign bdBaseDebitLC               = 0.
    if bdBaseCreditLC               = ? then assign bdBaseCreditLC              = 0.
    if bdBaseDebitCC                = ? then assign bdBaseDebitCC               = 0.
    if bdBaseCreditCC               = ? then assign bdBaseCreditCC              = 0.
    if bdVatDebitTC                 = ? then assign bdVatDebitTC                = 0.
    if bdVatCreditTC                = ? then assign bdVatCreditTC               = 0.
    if bdVatDebitLC                 = ? then assign bdVatDebitLC                = 0.
    if bdVatCreditLC                = ? then assign bdVatCreditLC               = 0.
    if bdVatDebitCC                 = ? then assign bdVatDebitCC                = 0.
    if bdVatCreditCC                = ? then assign bdVatCreditCC               = 0.
    if bcNormalTaxDivisionCode      = ? then assign bcNormalTaxDivisionCode     = "":U.
    if blNormalTaxIsAlreadyAbsRet   = ? then assign blNormalTaxIsAlreadyAbsRet  = false.
    if bcAbsRetTaxGLCode            = ? then assign bcAbsRetTaxGLCode           = "":U.
    if bcAbsRetTaxDivisionCode      = ? then assign bcAbsRetTaxDivisionCode     = "":U.
    if bcFromTaxZone                = ? then assign bcFromTaxZone               = "":U.
    if bcToTaxZone                  = ? then assign bcToTaxZone                 = "":U.
    if bcTaxEnvrionment             = ? then assign bcTaxEnvrionment            = "":U.
    if bcTaxClass                   = ? then assign bcTaxClass                  = "":U.
    if bcTaxUsage                   = ? then assign bcTaxUsage                  = "":U.
    if bcTaxType                    = ? then assign bcTaxType                   = "":U.
    if iiTaxAddressID               = ? then assign iiTaxAddressID              = 0.
    if bcTaxIDFeder                 = ? then assign bcTaxIDFeder                = "":U.
    if bcTaxIDState                 = ? then assign bcTaxIDState                = "":U.
    if bcTaxIDMisc1                 = ? then assign bcTaxIDMisc1                = "":U.
    if bcTaxIDMisc2                 = ? then assign bcTaxIDMisc2                = "":U.
    if bcTaxIDMisc3                 = ? then assign bcTaxIDMisc3                = "":U.
    if iiOwnAddressID               = ? then assign iiOwnAddressID              = 0.
    if bcOwnTaxIDFeder              = ? then assign bcOwnTaxIDFeder             = "":U.
    if bcOwnTaxIDState              = ? then assign bcOwnTaxIDState             = "":U.
    if bcOwnTaxIDMisc1              = ? then assign bcOwnTaxIDMisc1             = "":U.
    if bcOwnTaxIDMisc2              = ? then assign bcOwnTaxIDMisc2             = "":U.
    if bcOwnTaxIDMisc3              = ? then assign bcOwnTaxIDMisc3             = "":U.
    if biOwnTaxIDDeclarat           = ? then assign biOwnTaxIDDeclarat          = 0.
    if blIsSuspDel                  = ? then assign blIsSuspDel                 = false.
    if blIsTaxable = ?
    then do :
        assign vcMessage           = trim(substitute(#T-161'Internal error. The system cannot create the tax posting line because the Is Taxable field is missing.':255(68739)t-161#))
               viLocalReturnStatus = -1.
        <M-160 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-7796':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        Leave VALIDATIONSBLOCK.
    end. /* if blIsTaxable = ? */
    if bcExchangeRateType  = ? or bcExchangeRateType  = "":U
    then assign bcExchangeRateType = {&EXCHANGERATETYPE-ACCOUNTING}.
    if bdExchangeRate      = ? or 
       bdExchangeRate      = 0
    then if bcCurrencyCode = vcCompanyLC
         then assign bdExchangeRate = 1.
         else do :
            assign vcMessage           = trim(substitute(#T-163'Internal error. The system cannot create the tax posting line because the exchange rate is missing.':255(68740)t-163#))
                   viLocalReturnStatus = -1.
            <M-162 run SetMessage
               (input  vcMessage (icMessage), 
                input  '':U (icArguments), 
                input  '':U (icFieldName), 
                input  '':U (icFieldValue), 
                input  'E':U (icType), 
                input  3 (iiSeverity), 
                input  '':U (icRowid), 
                input  'QadFin-7797':U (icFcMsgNumber), 
                input  '':U (icFcExplanation), 
                input  '':U (icFcIdentification), 
                input  '':U (icFcContext), 
                output viFcReturnSuper (oiReturnStatus)) in BPosting>
            Leave VALIDATIONSBLOCK.
         end.
    if bdExchangeRateScale      = ? or 
       bdExchangeRateScale      = 0
    then if bcCurrencyCode = vcCompanyLC
         then assign bdExchangeRateScale = 1.
         else do :
            assign vcMessage           = trim(substitute(#T-165'Internal error. The system cannot create the tax posting line because the exchange rate scale is missing.':255(68741)t-165#))
                   viLocalReturnStatus = -1.
            <M-164 run SetMessage
               (input  vcMessage (icMessage), 
                input  '':U (icArguments), 
                input  '':U (icFieldName), 
                input  '':U (icFieldValue), 
                input  'E':U (icType), 
                input  3 (iiSeverity), 
                input  '':U (icRowid), 
                input  'QadFin-7798':U (icFcMsgNumber), 
                input  '':U (icFcExplanation), 
                input  '':U (icFcIdentification), 
                input  '':U (icFcContext), 
                output viFcReturnSuper (oiReturnStatus)) in BPosting>
            Leave VALIDATIONSBLOCK.
         end.
    if bcNormalTaxGLCode = ? or 
       bcNormalTaxGLCode = "":U
    then do :
        assign vcMessage           = trim(substitute(#T-167'Internal error. The GL account is missing for creating a tax posting line.':255(68742)t-167#))
               viLocalReturnStatus = -1.
        <M-166 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-7799':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        Leave VALIDATIONSBLOCK.
    end. /* if bcNormalTaxGLCode = ? or */
    if blNormalTaxIsAlreadyAbsRet  = true and 
       bcAbsRetTaxGLCode          <> "":U
    then do :
        assign vcMessage           = trim(substitute(#T-192'Internal error. A value was provided for the GL account for absorbed/retained tax, but the normal tax GL account has already been marked as absorbed/retained. ':255(69380)t-192#))
               viLocalReturnStatus = -1.
        <M-191 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-8024':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        Leave VALIDATIONSBLOCK.
    end. /* if blNormalTaxIsAlreadyAbsRet  = true and  */
    if btTaxPointDate = ?
    then do :
        assign vcMessage           = trim(substitute(#T-169'Internal error. The tax posting line cannot be created because the tax point date is missing.':255(68743)t-169#))
               viLocalReturnStatus = -1.
        <M-168 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-7800':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        Leave VALIDATIONSBLOCK.
    end. /* if btTaxPointDate = ? */
    if bcCurrencyCode = ? or
       bcCurrencyCode = "":U
    then do :
        assign vcMessage           = trim(substitute(#T-171'Internal error. The tax posting line cannot be created because the currency code is missing.':255(68744)t-171#))
               viLocalReturnStatus = -1.
        <M-170 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-7801':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        Leave VALIDATIONSBLOCK.
    end. /* if bcCurrencyCode = ? or */
    if bcPostingVatInOut <> {&VATINOUT-INPUT} and 
       bcPostingVatInOut <> {&VATINOUT-OUTPUT}
    then do :
        assign vcMessage           = trim(substitute(#T-173'Internal error. The posting tax direction used to create the tax posting line has an invalid value (&1).':255(68745)t-173#,bcPostingVatInOut)) + chr(10) +
                                     trim(substitute(#T-174'The list of valid values is &1.':255(68746)t-174#,{&VATINOUT-INPUT} + ",":U + {&VATINOUT-OUTPUT}))
               viLocalReturnStatus = -1.
        <M-172 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-7802':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        Leave VALIDATIONSBLOCK.
    end. /* if bcPostingVatInOut <> {&VATINOUT-INPUT} and  */
    if lookup(bcTransactionType, {&VATTRANSACTIONTYPES}, chr(2)) = 0
    then do :
        assign vcMessage           = trim(substitute(#T-176'Internal error. The transaction type is using an invalid value (&1) while creating a tax posting line.':255(68747)t-176#,bcTransactionType)) + chr(10) +
                                     trim(substitute(#T-177'The list of valid values is &1.':255(68746)t-177#,{&VATTRANSACTIONTYPES}))
               viLocalReturnStatus = -1.
        <M-175 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-7803':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        Leave VALIDATIONSBLOCK.
    end. /* if lookup(bcTransactionType, {&VATTRANSACTIONTYPES}, chr(2)) = 0 */
    if lookup(bcTaxTransactionType, {&VATTAXTRANSACTIONTYPES}, chr(2)) = 0
    then do :
        assign vcMessage           = trim(substitute(#T-179'Internal error. The transaction type is using an invalid value (&1) while creating a tax posting line.':255(68747)t-179#,bcTaxTransactionType)) + chr(10) +
                                     trim(substitute(#T-180'The list of valid values is &1.':255(68746)t-180#,{&VATTAXTRANSACTIONTYPES}))
               viLocalReturnStatus = -1.
        <M-178 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-7804':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        Leave VALIDATIONSBLOCK.
    end. /* if lookup(bcTaxTransactionType, {&VATTAXTRANSACTIONTYPES}, chr(2)) = 0 */
    find tPosting where 
         tPosting.tc_Rowid = bcPostingtcRowid 
         no-error.
    if not available tPosting
    then do:
        assign vcMessage           = trim(substitute(#T-157'Internal error. The system cannot find the posting based upon its row ID (&1).':255(68738)t-157#,bcPostingtcRowid))
               viLocalReturnStatus = -1.
        <M-159 run SetMessage
           (input  vcMessage (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-7795':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BPosting>
        Leave VALIDATIONSBLOCK.
    end. /* if not available tPosting */
    
    /* ============================================================== */
    /* Defaulting mechanism for the tax related fields of the address */
    /* ============================================================== */
    assign vlStartedAddressByIDMinimal = false.
    ADDRESSTAXREALTEDFIELDSBLOCK: DO :
        if iiTaxAddressID <> 0
        then do :
            if vlStartedAddressByIDMinimal = false
            then do :
                <Q-184 run AddressByIDMinimal  (Start) in BBusinessRelation >
                assign vlStartedAddressByIDMinimal = true.
            end. /* if vlStartedAddressByIDMinimal = false */
            <Q-182 run AddressByIDMinimal (all) (Read) (NoCache)
               (input iiTaxAddressID, (AddressID)
                output dataset tqAddressByIDMinimal) in BBusinessRelation >
            find tqAddressByIDMinimal where
                 tqAddressByIDMinimal.tiAddress_ID = iiTaxAddressID 
                 no-lock no-error.
            if not available tqAddressByIDMinimal
            then do :
                assign vcMessage           = trim(substitute(#T-188'The tax posting line cannot be created because the address ID (&1) is invalid.':255(68748)t-188#,string(iiTaxAddressID)))
                       viLocalReturnStatus = -1.
                <M-187 run SetMessage
                   (input  vcMessage (icMessage), 
                    input  '':U (icArguments), 
                    input  '':U (icFieldName), 
                    input  '':U (icFieldValue), 
                    input  'E':U (icType), 
                    input  3 (iiSeverity), 
                    input  '':U (icRowid), 
                    input  'QadFin-7806':U (icFcMsgNumber), 
                    input  '':U (icFcExplanation), 
                    input  '':U (icFcIdentification), 
                    input  '':U (icFcContext), 
                    output viFcReturnSuper (oiReturnStatus)) in BPosting>
                Leave ADDRESSTAXREALTEDFIELDSBLOCK.
            end. /* if available tqAddressByIDMinimal */
            assign bcTaxIDFeder = tqAddressByIDMinimal.tcAddressTaxIDFederal
                   bcTaxIDState = tqAddressByIDMinimal.tcAddressTaxIDState
                   bcTaxIDMisc1 = tqAddressByIDMinimal.tcAddressTaxIDMisc1
                   bcTaxIDMisc2 = tqAddressByIDMinimal.tcAddressTaxIDMisc2
                   bcTaxIDMisc3 = tqAddressByIDMinimal.tcAddressTaxIDMisc3.
        end. /* if iiTaxAddressID <> 0 */
        if iiOwnAddressID <> 0
        then do :
            if vlStartedAddressByIDMinimal = false
            then do :
                <Q-185 run AddressByIDMinimal  (Start) in BBusinessRelation >
                assign vlStartedAddressByIDMinimal = true.
            end. /* if vlStartedAddressByIDMinimal = false */
            <Q-183 run AddressByIDMinimal (all) (Read) (NoCache)
               (input iiOwnAddressID, (AddressID)
                output dataset tqAddressByIDMinimal) in BBusinessRelation >
            find tqAddressByIDMinimal where
                 tqAddressByIDMinimal.tiAddress_ID = iiOwnAddressID 
                 no-lock no-error.
            if not available tqAddressByIDMinimal
            then do :
                assign vcMessage           = trim(substitute(#T-190'The tax posting line cannot be created because the address ID (&1) is invalid.':255(68748)t-190#,string(iiOwnAddressID)))
                       viLocalReturnStatus = -1.
                <M-189 run SetMessage
                   (input  vcMessage (icMessage), 
                    input  '':U (icArguments), 
                    input  '':U (icFieldName), 
                    input  '':U (icFieldValue), 
                    input  'E':U (icType), 
                    input  3 (iiSeverity), 
                    input  '':U (icRowid), 
                    input  'QadFin-7807':U (icFcMsgNumber), 
                    input  '':U (icFcExplanation), 
                    input  '':U (icFcIdentification), 
                    input  '':U (icFcContext), 
                    output viFcReturnSuper (oiReturnStatus)) in BPosting>
                Leave ADDRESSTAXREALTEDFIELDSBLOCK.
            end. /* if available tqAddressByIDMinimal */
            assign bcOwnTaxIDFeder    = tqAddressByIDMinimal.tcAddressTaxIDFederal
                   bcOwnTaxIDState    = tqAddressByIDMinimal.tcAddressTaxIDState
                   bcOwnTaxIDMisc1    = tqAddressByIDMinimal.tcAddressTaxIDMisc1
                   bcOwnTaxIDMisc2    = tqAddressByIDMinimal.tcAddressTaxIDMisc2
                   bcOwnTaxIDMisc3    = tqAddressByIDMinimal.tcAddressTaxIDMisc3
                   biOwnTaxIDDeclarat = tqAddressByIDMinimal.tiAddressTaxDeclaration.
        end. /* if iiOwnAddressID <> 0 */
    END. /* ADDRESSTAXREALTEDFIELDSBLOCK. */
    if vlStartedAddressByIDMinimal = true
    then do :
        <Q-186 run AddressByIDMinimal  (Stop) in BBusinessRelation >
    end. /* if vlStartedAddressByIDMinimal = false */
    if viLocalReturnStatus < 0
    then Leave VALIDATIONSBLOCK.
    
END. /* VALIDATIONSBLOCK */

/* ================== */
/* Exception handling */
/* ================== */    
assign oiReturnStatus = viLocalReturnStatus.