project QadFinancials > class BOpenItemAdjustment > method OIAdjCommit

Description

OIAdjCommit; Save the whole adjustment


Parameters


tOIAdjinputtemp-tableTemp-table containing all the adjustment lines
tOIAdjStageinputtemp-tableTemp-table containing all the staged-details of the adjustment lines
ilStopProcessingWhenWarninginputlogicalSet this parameter to TRUE if you want to stop processing during Submit of Open Item Adjustment. In this case this warning appears on the UI and user can decide what to do.
This parameter is used for workaround as this component is not implemented in standard manner.
icDescriptioninputcharacterDescription that the user can fill in describing the OI adjustment
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


unused


program code (program8/bopenitemadjustment.p)

/* ====================================== */
/* Exception handling - processing block  */
/* ====================================== */
assign oiReturnStatus      = -98
       viLocalReturnStatus = 0.
MAJORCOMMITBLOCK : DO :
    
    /* ======================= */
    /* No input -> no action   */
    /* ======================= */
    if not can-find (first tOIAdj)
    then do :
        assign vcMsgOIAdj          = trim(#T-72'No actions will be taken since no open item adjustments were created.':255(2916)T-72#)
               viLocalReturnStatus = -1.
        <M-71 run SetMessage
           (input  vcMsgOIAdj (icMessage), 
            input  '':U (icArguments), 
            input  '':U (icFieldName), 
            input  '':U (icFieldValue), 
            input  'E':U (icType), 
            input  3 (iiSeverity), 
            input  '':U (icRowid), 
            input  'QADFIN-1816':U (icFcMsgNumber), 
            input  '' (icFcExplanation), 
            input  '' (icFcIdentification), 
            input  '' (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BOpenItemAdjustment>
        Leave MAJORCOMMITBLOCK.
    end. /* if not can-find (first tOIAdj) */

    /* ======================================================== */
    /* Make sure all external components except BJE are stopped */
    /* Clear the instance-tables of this method as well         */
    /* ======================================================== */
    <M-1 run StopExternalInstancesExceptBJE (output viFcReturnSuper (oiReturnStatus)) in BOpenItemAdjustment>
    if viFcReturnSuper <> 0 then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper  < 0 then Leave MAJORCOMMITBLOCK.
    <M-171 run ClearData  (output viFcReturnSuper (oiReturnStatus)) in BOpenItemAdjustment>
    if viFcReturnSuper <> 0 then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper  < 0 then Leave MAJORCOMMITBLOCK.
    
    /* ================================= */
    /* Assign the description field      */    
    /* ================================= */
    
    assign vcMainDescription = icDescription.

    
    /* ==================== */
    /* Validation method 1. */
    /* ==================== */
    <M-168 run OIAdjCommitValidateOne  (output viFcReturnSuper (oiReturnStatus)) in BOpenItemAdjustment>
    if viFcReturnSuper <> 0 then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper  < 0 then Leave MAJORCOMMITBLOCK.
    
    /* ==================== */
    /* Validation method 2. */
    /* ==================== */
    <M-170 run OIAdjCommitValidateTwo  (output viFcReturnSuper (oiReturnStatus)) in BOpenItemAdjustment>
    if viFcReturnSuper <> 0 then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper  < 0 then Leave MAJORCOMMITBLOCK.

    /* ==================== */
    /* Validation method 3. */
    /* ==================== */
    <M-85 run OIAdjCommitValidateThree  (output viFcReturnSuper (oiReturnStatus)) in BOpenItemAdjustment>
    if viFcReturnSuper <> 0 then assign viLocalReturnStatus = viFcReturnSuper.
    if viFcReturnSuper  < 0 then Leave MAJORCOMMITBLOCK.

    /* ============================================== */
    /* Run submethod that will do the main processing */
    /* ============================================== */
    if viLocalReturnStatus > 0 and not ilStopProcessingWhenWarning or
       viLocalReturnStatus = 0
    then do:
        <M-129 run OIAdjCommitSub
           (input  ilStopProcessingWhenWarning (ilStopProcessingWhenWarning), 
            output viFcReturnSuper (oiReturnStatus)) in BOpenItemAdjustment>
        if viFcReturnSuper <> 0 then viLocalReturnStatus = viFcReturnSuper.
        if viFcReturnSuper  < 0 then Leave MAJORCOMMITBLOCK.
    end.

END. /* MAJORCOMMITBLOCK */

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