project QadFinancials > class BAPMatching > method GetPendingVouchersAssignPendingMatchFields

Description

GetPendingVouchersAssignPendingMatchFields: submethod of GetPendingVouchers that is located in the same segment and that takes care of assigning amount and qty of the pvod on other initial APMatchings


Parameters


icAPMatchingTcRowidinputcharactericAPMatchingTcRowid: Rowid (converted to character) of the matching. This corresponds with field tAPMatching.tc_rowid.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BAPMatching.GetPendingVouchersLogCharges
method BAPMatching.GetPendingVouchersNoLogCharges
method BAPMatching.GetPendingVouchersPOShipper


program code (program7/bapmatching.p)

/* ================================================================================================ */
    /* GetPendingVouchersAssignCostMethods: submethod of GetPendingVouchers that is located in the same */
    /* segment and that takes care of assigning the Cost-method related fields in tPendingVoucherAPM    */
    /* ================================================================================================ */
    
    
    /* ===================================================== */
    /* Default return-status                                 */
    /* Check the required record-availability                */
    /* ===================================================== */
    assign oiReturnStatus = -98.
    if not available tPendingVoucherAPM
    then do :
        assign oiReturnStatus  = -3
               vcMsgAPMatching = trim(substitute(#T-7'Internal error: information is missing.':255(49818)t-7#)) + chr(10) + 
                                 trim(substitute(#T-8'Missing record available: &1.':234(56668)T-8#,"tPendingVoucherAPM":U)) .
        <M-6 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-5766':U (icFcMsgNumber), 
                     input  '':U (icFcExplanation), 
                     input  '':U (icFcIdentification), 
                     input  '':U (icFcContext), 
                     output viFcReturnSuper (oiReturnStatus)) in BAPMatching>
        Return.
    end. /* if not avail tPendingVoucherAPM */
    
    /* ==================================================================================== */
    /* Compose the Amount and the Qty of this Pvod that is located on other APMatchingLines */
    /* linked to this Pvod and with APMatching.APMatchingStatus = Initial                   */
    /* The field that are assigned here, exist just for informational reasons (no BL-logic) */
    /* ==================================================================================== */
    <Q-9 run APMatchingLnByStatusPvod (all) (Read) (NoCache)
       (input ?, (CompanyId)
        input tPendingVoucherAPM.PvoDomain, (PvoDomain)
        input tPendingVoucherAPM.PvoID, (PvoID)
        input tPendingVoucherAPM.PvodLineID, (PvodLineID)
        input {&APMATCHINGSTATUS-INITIAL}, (APMatchingStatus)
        input icAPMatchingTcRowid, (SkipAPMatchingLnRowid)
        output dataset tqAPMatchingLnByStatusPvod) in BAPMatching >  
    for each tqAPMatchingLnByStatusPvod no-lock :
        assign tPendingVoucherAPM.tdAPMatchingLnPendingMatchQty   = tPendingVoucherAPM.tdAPMatchingLnPendingMatchQty   + tqAPMatchingLnByStatusPvod.tdAPMatchingLnMatchQty
               tPendingVoucherAPM.tdAPMatchingLnPendingMatchAmtTC = tPendingVoucherAPM.tdAPMatchingLnPendingMatchAmtTC + tqAPMatchingLnByStatusPvod.tdAPMatchingLnMatchAmtTC.
    end. /* for each tqAPMatchingLnByStatusPvod */
        
    /* ===================================================== */
    /* Default return-status                                 */
    /* ===================================================== */
    if oiReturnStatus = -98
    then assign oiReturnStatus= 0.