project QadFinancials > class BAPMatching > method GetGLPLVarRate

Description

AdditionalUpdatesAllLinesPLVarRate; submethod of AdditionalUpdatesAllLines that is located in the same segment and that takes care of the creation of a posting-line for the RateVariance (difference in price)


Parameters


icAPMatchingLnGLCodeinputcharacter
icAPMatchingLnDivCodeinputcharacter
icAPMatchingLnCCCodeinputcharacter
ilAPMatchingLnIsVarGLPostinginputlogical
idAPMatchingLnMatchQtyinputdecimal
idAPMatchingLnMatchUnitPriceinputdecimal
icAPMatchingLnPvodCCCodeinputcharacter
icAPMatchingLnPvodCostMtdCurinputcharacter
icAPMatchingLnPvodCostMtdGLinputcharacter
icAPMatchingLnPvodDivCodeinputcharacter
icAPMatchingLnPvodGLCodeinputcharacter
ilAPMatchingLnPvodIsLgChargeinputlogical
icAPMatchingLnPvodIteminputcharacter
icAPMatchingLnPvodItemTypeinputcharacter
icAPMatchingLnPvodLgChargeinputcharacter
icAPMatchingLnPvodPrjCodeinputcharacter
idAPMatchingLnPvodReceiptQtyinputdecimal
icAPMatchingLnPvodSiteinputcharacter
idAPMatchingLnPvodUnitPriceinputdecimal
idAPMatchingLnVarRateTCinputdecimal
icPvoDomaininputcharacter
iiPvoIdinputinteger
iiPvodLineIDinputinteger
icPvodOpAllocCodeinputcharacterInput parameter: Pending voucher operational allocation code.
icOpAllocCodeinputcharacterInput parameter. Operational Allocation Code.
icpod_locinputcharacter
iipod_opinputinteger
icpod_wo_Lotinputcharacter
icprh_siteinputcharacter
icprh_typeinputcharacter
icprh_vendinputcharacter
icpt_prod_lineinputcharacter
icpt_siteinputcharacter
icpvo_order_typeinputcharacter
icpvo_shipfrominputcharacter
icpvo_shiptoinputcharacter
icpvod_channelinputcharacter
icpvod_shiptoinputcharacter
icvd_typeinputcharacter
ocNormalRateVarGLCodeoutputcharacter
ocNormalRateVarDivisionCodeoutputcharacter
ocNormalRateVarCostCentreCodeoutputcharacter
ocDiscrepancyGLCodeoutputcharacter
ocDiscrepancyDivisionCodeoutputcharacter
ocDiscrepancyCostCentreCodeoutputcharacter
ocLogRateVarGLCodeoutputcharacter
ocLogRateVarDivisionCodeoutputcharacter
ocLogRateVarCostCentreCodeoutputcharacter
ocPPVGLCodeoutputcharacter
ocPPVDivCodeoutputcharacter
ocPPVCCCodeoutputcharacter
ocRateVarGLCodeoutputcharacter
ocRateVarDivisionCodeoutputcharacter
ocRateVarCostCentreCodeoutputcharacter
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BAPMatching.AdditionalUpdatesAllLinesPLVarRate
method BAPMatching.ValidateComponentPreAPMCInvoiceLegalDocument


program code (program6/bapmatching.p)

/* ====================================================================================== *
 * Method       : GetGLPLVarRate                                                          *
 * Description  : This method retrieves GL, Division, Cost centre where the rate variance *
 *                amount should be posted.                                                *
 * ====================================================================================== */
 
MAIN_BLOCK:
do on error undo, throw:
    
    /* ==================================================================================== */
    /* To find out the correct GL, Division and CostCentre that should be used for this     */
    /* posting-line, we splitt up the code into 3 submethods because otherwise this method  */
    /* cannot hold all program code.                                                        */
    /* Possibilities:                                                                       */
    /*  1: Logistic charges                                                                 */
    /*  2: Non-logistic charages & Discrepancy-accounts                                     */
    /*  3: Non-logistic charages & Average-costing                                          */
    /*  4: Non-logistic charages & Non-Average-costing & Non-discrepancy-accounts           */
    /* ==================================================================================== */
    if ilAPMatchingLnPvodIsLgCharge = true
    then do :
        <M-38 run GetGLPLVarRateLogCharge
           (input  icAPMatchingLnGLCode (icAPMatchingLnGLCode), 
            input  icAPMatchingLnDivCode (icAPMatchingLnDivCode), 
            input  icAPMatchingLnCCCode (icAPMatchingLnCCCode), 
            input  ilAPMatchingLnIsVarGLPosting (ilAPMatchingLnIsVarGLPosting), 
            input  idAPMatchingLnMatchQty (idAPMatchingLnMatchQty), 
            input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnMatchUnitPrice), 
            input  icAPMatchingLnPvodCCCode (icAPMatchingLnPvodCCCode), 
            input  icAPMatchingLnPvodCostMtdCur (icAPMatchingLnPvodCostMtdCur), 
            input  icAPMatchingLnPvodCostMtdGL (icAPMatchingLnPvodCostMtdGL), 
            input  icAPMatchingLnPvodDivCode (icAPMatchingLnPvodDivCode), 
            input  icAPMatchingLnPvodGLCode (icAPMatchingLnPvodGLCode), 
            input  ilAPMatchingLnPvodIsLgCharge (ilAPMatchingLnPvodIsLgCharge), 
            input  icAPMatchingLnPvodItem (icAPMatchingLnPvodItem), 
            input  icAPMatchingLnPvodItemType (icAPMatchingLnPvodItemType), 
            input  icAPMatchingLnPvodLgCharge (icAPMatchingLnPvodLgCharge), 
            input  icAPMatchingLnPvodPrjCode (icAPMatchingLnPvodPrjCode), 
            input  idAPMatchingLnPvodReceiptQty (idAPMatchingLnPvodReceiptQty), 
            input  icAPMatchingLnPvodSite (icAPMatchingLnPvodSite), 
            input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnPvodUnitPrice), 
            input  idAPMatchingLnVarRateTC (idAPMatchingLnVarRateTC), 
            input  icPvoDomain (icPvoDomain), 
            input  icPvodOpAllocCode (icQADC01), 
            input  icOpAllocCode (icQADC02), 
            input  icpod_loc (icpod_loc), 
            input  iipod_op (iipod_op), 
            input  icpod_wo_lot (icpod_wo_Lot), 
            input  icprh_site (icprh_site), 
            input  icprh_type (icprh_type), 
            input  icprh_vend (icprh_vend), 
            input  icpt_prod_line (icpt_prod_line), 
            input  icpt_site (icpt_site), 
            input  icpvo_order_type (icpvo_order_type), 
            input  icpvo_shipfrom (icpvo_shipfrom), 
            input  icpvo_shipto (icpvo_shipto), 
            input  icpvod_channel (icpvod_channel), 
            input  icpvod_shipto (icpvod_shipto), 
            input  icvd_type (icvd_type), 
            output ocLogRateVarGLCode (ocGLCode), 
            output ocLogRateVarDivisionCode (ocDivisionCode), 
            output ocLogRateVarCostCentreCode (ocCostCentreCode), 
            output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
        if viFcReturnSuper < 0 or viFcReturnSuper > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viFcReturnSuper.
        if oiReturnStatus  < 0 then return.

        assign ocRateVarGLCode         = ocLogRateVarGLCode
               ocRateVarDivisionCode   = ocLogRateVarDivisionCode
               ocRateVarCostCentreCode = ocLogRateVarCostCentreCode.
        
    end. /* if ilAPMatchingLnPvodIsLgCharge = true */
    else 
        if icAPMatchingLnPvodItemType   = {&APMATCHINGLNPVODITEMTYPE-NORMAL} and 
           icAPMatchingLnPvodCostMtdGL  = {&COSTMETHOD-AVERAGE}              and 
           idAPMatchingLnPvodReceiptQty < 0
        then do:
            <M-73 run GetGLPLVarRateDiscrepancy
               (input  icAPMatchingLnGLCode (icAPMatchingLnGLCode), 
                input  icAPMatchingLnDivCode (icAPMatchingLnDivCode), 
                input  icAPMatchingLnCCCode (icAPMatchingLnCCCode), 
                input  ilAPMatchingLnIsVarGLPosting (ilAPMatchingLnIsVarGLPosting), 
                input  idAPMatchingLnMatchQty (idAPMatchingLnMatchQty), 
                input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnMatchUnitPrice), 
                input  icAPMatchingLnPvodCCCode (icAPMatchingLnPvodCCCode), 
                input  icAPMatchingLnPvodCostMtdCur (icAPMatchingLnPvodCostMtdCur), 
                input  icAPMatchingLnPvodCostMtdGL (icAPMatchingLnPvodCostMtdGL), 
                input  icAPMatchingLnPvodDivCode (icAPMatchingLnPvodDivCode), 
                input  icAPMatchingLnPvodGLCode (icAPMatchingLnPvodGLCode), 
                input  ilAPMatchingLnPvodIsLgCharge (ilAPMatchingLnPvodIsLgCharge), 
                input  icAPMatchingLnPvodItem (icAPMatchingLnPvodItem), 
                input  icAPMatchingLnPvodItemType (icAPMatchingLnPvodItemType), 
                input  icAPMatchingLnPvodLgCharge (icAPMatchingLnPvodLgCharge), 
                input  icAPMatchingLnPvodPrjCode (icAPMatchingLnPvodPrjCode), 
                input  idAPMatchingLnPvodReceiptQty (idAPMatchingLnPvodReceiptQty), 
                input  icAPMatchingLnPvodSite (icAPMatchingLnPvodSite), 
                input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnPvodUnitPrice), 
                input  idAPMatchingLnVarRateTC (idAPMatchingLnVarRateTC), 
                input  icPvoDomain (icPvoDomain), 
                input  iiPvoId (iiPvoId), 
                input  iiPvodLineID (iiPvodLineID), 
                input  icPvodOpAllocCode (icQADC01), 
                input  icOpAllocCode (icQADC02), 
                input  icpod_loc (icpod_loc), 
                input  iipod_op (iipod_op), 
                input  icpod_wo_lot (icpod_wo_Lot), 
                input  icprh_site (icprh_site), 
                input  icprh_type (icprh_type), 
                input  icprh_vend (icprh_vend), 
                input  icpt_prod_line (icpt_prod_line), 
                input  icpt_site (icpt_site), 
                input  icpvo_order_type (icpvo_order_type), 
                input  icpvo_shipfrom (icpvo_shipfrom), 
                input  icpvo_shipto (icpvo_shipto), 
                input  icpvod_channel (icpvod_channel), 
                input  icpvod_shipto (icpvod_shipto), 
                input  icvd_type (icvd_type), 
                output ocDiscrepancyGLCode (ocGLCode), 
                output ocDiscrepancyDivisionCode (ocDivisionCode), 
                output ocDiscrepancyCostCentreCode (ocCostCentreCode), 
                output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
            if viFcReturnSuper < 0 or viFcReturnSuper > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viFcReturnSuper.
            if oiReturnStatus  < 0 then return.

            assign ocRateVarGLCode         = ocDiscrepancyGLCode
                   ocRateVarDivisionCode   = ocDiscrepancyDivisionCode
                   ocRateVarCostCentreCode = ocDiscrepancyCostCentreCode. 
        end.
        else do:
            if icAPMatchingLnPvodCostMtdGL   = {&COSTMETHOD-AVERAGE}              and
               icAPMatchingLnPvodItemType    = {&APMATCHINGLNPVODITEMTYPE-NORMAL} and 
               ilAPMatchingLnIsVarGLPosting  = false                              and 
               icAPMatchingLnPvodGLCode     <> "":U                               and 
               icAPMatchingLnPvodGLCode     <> ?
            then do:
            
                <M-74 run GetGLPLVarRateAvgCosting
                   (input  icAPMatchingLnGLCode (icAPMatchingLnGLCode), 
                    input  icAPMatchingLnDivCode (icAPMatchingLnDivCode), 
                    input  icAPMatchingLnCCCode (icAPMatchingLnCCCode), 
                    input  ilAPMatchingLnIsVarGLPosting (ilAPMatchingLnIsVarGLPosting), 
                    input  idAPMatchingLnMatchQty (idAPMatchingLnMatchQty), 
                    input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnMatchUnitPrice), 
                    input  icAPMatchingLnPvodCCCode (icAPMatchingLnPvodCCCode), 
                    input  icAPMatchingLnPvodCostMtdCur (icAPMatchingLnPvodCostMtdCur), 
                    input  icAPMatchingLnPvodCostMtdGL (icAPMatchingLnPvodCostMtdGL), 
                    input  icAPMatchingLnPvodDivCode (icAPMatchingLnPvodDivCode), 
                    input  icAPMatchingLnPvodGLCode (icAPMatchingLnPvodGLCode), 
                    input  ilAPMatchingLnPvodIsLgCharge (ilAPMatchingLnPvodIsLgCharge), 
                    input  icAPMatchingLnPvodItem (icAPMatchingLnPvodItem), 
                    input  icAPMatchingLnPvodItemType (icAPMatchingLnPvodItemType), 
                    input  icAPMatchingLnPvodLgCharge (icAPMatchingLnPvodLgCharge), 
                    input  icAPMatchingLnPvodPrjCode (icAPMatchingLnPvodPrjCode), 
                    input  idAPMatchingLnPvodReceiptQty (idAPMatchingLnPvodReceiptQty), 
                    input  icAPMatchingLnPvodSite (icAPMatchingLnPvodSite), 
                    input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnPvodUnitPrice), 
                    input  idAPMatchingLnVarRateTC (idAPMatchingLnVarRateTC), 
                    input  icPvoDomain (icPvoDomain), 
                    input  icPvodOpAllocCode (icQADC01), 
                    input  icOpAllocCode (icQADC02), 
                    input  icpod_loc (icpod_loc), 
                    input  iipod_op (iipod_op), 
                    input  icpod_wo_lot (icpod_wo_Lot), 
                    input  icprh_site (icprh_site), 
                    input  icprh_type (icprh_type), 
                    input  icprh_vend (icprh_vend), 
                    input  icpt_prod_line (icpt_prod_line), 
                    input  icpt_site (icpt_site), 
                    input  icpvo_order_type (icpvo_order_type), 
                    input  icpvo_shipfrom (icpvo_shipfrom), 
                    input  icpvo_shipto (icpvo_shipto), 
                    input  icpvod_channel (icpvod_channel), 
                    input  icpvod_shipto (icpvod_shipto), 
                    input  icvd_type (icvd_type), 
                    output ocPPVGLCode (ocGLCode), 
                    output ocPPVDivCode (ocDivisionCode), 
                    output ocPPVCCCode (ocCostCentreCode), 
                    output viFcReturnSuper (oiReturnStatus)) in BAPMatching>                              
                if viFcReturnSuper < 0 or viFcReturnSuper > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viFcReturnSuper.
                if oiReturnStatus  < 0 then return.
     
                assign ocRateVarGLCode         = ocPPVGLCode 
                       ocRateVarDivisionCode   = ocPPVDivCode 
                       ocRateVarCostCentreCode = ocPPVCCCode.

                /* =================================================================================================================== */
                /* Sometimes we also need discrepancy account. This is in case, that quantity on hand are lowere then matched quantity */
                /* =================================================================================================================== */
            
                /* Check if Qty On hand for Item < matcheed Qty, if yes, retrive Inventory Discrepency Account Details */
                <Q-61 run InventoryOnHandQtyForItem (all) (Read) (Cache)
                   (input icPvoDomain, (Domain)
                    input icAPMatchingLnPvodSite, (Site)
                    input icAPMatchingLnPvodItem, (Part)
                    output dataset tqInventoryOnHandQtyForItem) in BMfgInventory>
                    
                find first tqInventoryOnHandQtyForItem where
                           tqInventoryOnHandQtyForItem.tcin_domain = icPvoDomain            and
                           tqInventoryOnHandQtyForItem.tcin_site   = icAPMatchingLnPvodSite and
                           tqInventoryOnHandQtyForItem.tcin_part   = icAPMatchingLnPvodItem
                           no-error.     
                if available tqInventoryOnHandQtyForItem
                then assign vdOnHandQty = tqInventoryOnHandQtyForItem.tdin_qty_oh + 
                                          tqInventoryOnHandQtyForItem.tdin_qty_nonet.

                if vdOnHandQty                  <  idAPMatchingLnMatchQty and 
                   vdOnHandQty                  >= 0                      and
                   idAPMatchingLnMatchUnitPrice >  idAPMatchingLnPvodUnitPrice
                then do:
                    /* Find Product Line Discrepency Account Details in the pld_det - Inventory Account */
                    <M-16 run GetGLPLVarRateDiscrepancy
                       (input  icAPMatchingLnGLCode (icAPMatchingLnGLCode), 
                        input  icAPMatchingLnDivCode (icAPMatchingLnDivCode), 
                        input  icAPMatchingLnCCCode (icAPMatchingLnCCCode), 
                        input  ilAPMatchingLnIsVarGLPosting (ilAPMatchingLnIsVarGLPosting), 
                        input  idAPMatchingLnMatchQty (idAPMatchingLnMatchQty), 
                        input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnMatchUnitPrice), 
                        input  icAPMatchingLnPvodCCCode (icAPMatchingLnPvodCCCode), 
                        input  icAPMatchingLnPvodCostMtdCur (icAPMatchingLnPvodCostMtdCur), 
                        input  icAPMatchingLnPvodCostMtdGL (icAPMatchingLnPvodCostMtdGL), 
                        input  icAPMatchingLnPvodDivCode (icAPMatchingLnPvodDivCode), 
                        input  icAPMatchingLnPvodGLCode (icAPMatchingLnPvodGLCode), 
                        input  ilAPMatchingLnPvodIsLgCharge (ilAPMatchingLnPvodIsLgCharge), 
                        input  icAPMatchingLnPvodItem (icAPMatchingLnPvodItem), 
                        input  icAPMatchingLnPvodItemType (icAPMatchingLnPvodItemType), 
                        input  icAPMatchingLnPvodLgCharge (icAPMatchingLnPvodLgCharge), 
                        input  icAPMatchingLnPvodPrjCode (icAPMatchingLnPvodPrjCode), 
                        input  idAPMatchingLnPvodReceiptQty (idAPMatchingLnPvodReceiptQty), 
                        input  icAPMatchingLnPvodSite (icAPMatchingLnPvodSite), 
                        input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnPvodUnitPrice), 
                        input  idAPMatchingLnVarRateTC (idAPMatchingLnVarRateTC), 
                        input  icPvoDomain (icPvoDomain), 
                        input  iiPvoId (iiPvoId), 
                        input  iiPvodLineID (iiPvodLineID), 
                        input  icPvodOpAllocCode (icQADC01), 
                        input  icOpAllocCode (icQADC02), 
                        input  icpod_loc (icpod_loc), 
                        input  iipod_op (iipod_op), 
                        input  icpod_wo_lot (icpod_wo_Lot), 
                        input  icprh_site (icprh_site), 
                        input  icprh_type (icprh_type), 
                        input  icprh_vend (icprh_vend), 
                        input  icpt_prod_line (icpt_prod_line), 
                        input  icpt_site (icpt_site), 
                        input  icpvo_order_type (icpvo_order_type), 
                        input  icpvo_shipfrom (icpvo_shipfrom), 
                        input  icpvo_shipto (icpvo_shipto), 
                        input  icpvod_channel (icpvod_channel), 
                        input  icpvod_shipto (icpvod_shipto), 
                        input  icvd_type (icvd_type), 
                        output ocDiscrepancyGLCode (ocGLCode), 
                        output ocDiscrepancyDivisionCode (ocDivisionCode), 
                        output ocDiscrepancyCostCentreCode (ocCostCentreCode), 
                        output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
                        
                    if viFcReturnSuper < 0 or viFcReturnSuper > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viFcReturnSuper.
                    if oiReturnStatus  < 0 then return.

                end. /* if vdOnHandQty < idAPMatchingLnMatchQty */                        
            end. /* if icAPMatchingLnPvodCostMtdGL = {&COSTMETHOD-AVERAGE} and */
            else do:
                <M-31 run GetGLPLVarRateNormal
                   (input  icAPMatchingLnGLCode (icAPMatchingLnGLCode), 
                    input  icAPMatchingLnDivCode (icAPMatchingLnDivCode), 
                    input  icAPMatchingLnCCCode (icAPMatchingLnCCCode), 
                    input  ilAPMatchingLnIsVarGLPosting (ilAPMatchingLnIsVarGLPosting), 
                    input  idAPMatchingLnMatchQty (idAPMatchingLnMatchQty), 
                    input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnMatchUnitPrice), 
                    input  icAPMatchingLnPvodCCCode (icAPMatchingLnPvodCCCode), 
                    input  icAPMatchingLnPvodCostMtdCur (icAPMatchingLnPvodCostMtdCur), 
                    input  icAPMatchingLnPvodCostMtdGL (icAPMatchingLnPvodCostMtdGL), 
                    input  icAPMatchingLnPvodDivCode (icAPMatchingLnPvodDivCode), 
                    input  icAPMatchingLnPvodGLCode (icAPMatchingLnPvodGLCode), 
                    input  ilAPMatchingLnPvodIsLgCharge (ilAPMatchingLnPvodIsLgCharge), 
                    input  icAPMatchingLnPvodItem (icAPMatchingLnPvodItem), 
                    input  icAPMatchingLnPvodItemType (icAPMatchingLnPvodItemType), 
                    input  icAPMatchingLnPvodLgCharge (icAPMatchingLnPvodLgCharge), 
                    input  icAPMatchingLnPvodPrjCode (icAPMatchingLnPvodPrjCode), 
                    input  idAPMatchingLnPvodReceiptQty (idAPMatchingLnPvodReceiptQty), 
                    input  icAPMatchingLnPvodSite (icAPMatchingLnPvodSite), 
                    input  idAPMatchingLnMatchUnitPrice (idAPMatchingLnPvodUnitPrice), 
                    input  idAPMatchingLnVarRateTC (idAPMatchingLnVarRateTC), 
                    input  icPvoDomain (icPvoDomain), 
                    input  icPvodOpAllocCode (icQADC01), 
                    input  icOpAllocCode (icQADC02), 
                    input  icpod_loc (icpod_loc), 
                    input  iipod_op (iipod_op), 
                    input  icpod_wo_lot (icpod_wo_Lot), 
                    input  icprh_site (icprh_site), 
                    input  icprh_type (icprh_type), 
                    input  icprh_vend (icprh_vend), 
                    input  icpt_prod_line (icpt_prod_line), 
                    input  icpt_site (icpt_site), 
                    input  icpvo_order_type (icpvo_order_type), 
                    input  icpvo_shipfrom (icpvo_shipfrom), 
                    input  icpvo_shipto (icpvo_shipto), 
                    input  icpvod_channel (icpvod_channel), 
                    input  icpvod_shipto (icpvod_shipto), 
                    input  icvd_type (icvd_type), 
                    output ocNormalRateVarGLCode (ocGLCode), 
                    output ocNormalRateVarDivisionCode (ocDivisionCode), 
                    output ocNormalRateVarCostCentreCode (ocCostCentreCode), 
                    output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
                if viFcReturnSuper < 0 or viFcReturnSuper > 0 and oiReturnStatus = 0 then assign oiReturnStatus = viFcReturnSuper.
                if oiReturnStatus  < 0 then return.

                assign ocRateVarGLCode         = ocNormalRateVarGLCode
                       ocRateVarDivisionCode   = ocNormalRateVarDivisionCode
                       ocRateVarCostCentreCode = ocNormalRateVarCostCentreCode. 
                                 
            end. /* not if icAPMatchingLnPvodCostMtdGL = {&COSTMETHOD-AVERAGE} and*/
        end. /* Not if ilAPMatchingLnPvodIsLgCharge = true */
    /* End Not if ilAPMatchingLnPvodIsLgCharge = true */

    If viFcReturnSuper <> 0 then assign oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0  then Return.
    
    /* ========================================= */
    /* Check wether we have a G/L account by now */
    /* ========================================= */
    if (ocRateVarGLCode = "":U or 
        ocRateVarGLCode = ?) and
       (icPvodOpAllocCode = "":U or
        icPvodOpAllocCode = ?)
    then do:
        assign oiReturnStatus  = -3
               vcMsgAPMatching = #T-36'The system cannot find the required accounting information to retrieve GL account for the posting line on the rate variances.':255(164006285)T-36#.
        <M-35 run SetMessage
           (input  vcMsgAPMatching (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QadFin-5530':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
        Return.
    end. /* if vcGLCode = "":U or */
end. /* MAIN_BLOCK */