project QadFinancials > class BDPaymentSelection > method AdditionalUpdates

Description

This method is part of the SetPublicTables flow.
When executed, data in the input class tables (prefix t_s) is validated and found correct, and copied into the class tables (prefix t_o).
This method can be extended to do updates that do not require a validation or that involve running business methods of other business classes. These classes should be started with ADD-TO-TRANSACTION = 'true'. Also make sure to add these classes in method StopExternalInstances.


Parameters


oiReturnStatusoutputinteger


Internal usage


QadFinancials
method BDPaymentSelection.DeleteDPaySelLine
method BDPaymentSelection.StoreBankReference
method BDPaymentSelection.UpdateDPaySelAndPayCode

QadFitnesse
method BDPaymentSelection.ApiDPaymentSelectionCreate


program code (program/bdpaymentselection.p)

empty temp-table tDCollectionPaySel.

<M-31 run AdditionalUpdatesDInvoice  (output viFcReturnSuper (oiReturnStatus)) in BDPaymentSelection>
if viFcReturnSuper < 0 or
   oiReturnStatus  = 0
then assign oiReturnStatus = viFcReturnSuper.

if oiReturnStatus < 0
then do:
    <M-58 run StopExternalInstances  (output viFcReturnSuper (oiReturnStatus)) in BDPaymentSelection>
    return.
end.

<ANCESTOR-CODE>

addupdates: 
do on error undo, throw:
    <M-2 run AdditionalUpdatesDDocument  (output oiReturnStatus (oiReturnStatus)) in BDPaymentSelection>    
    if viFcReturnSuper < 0 or oiReturnStatus = 0 
    then assign oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper < 0 
    then leave addupdates.
     
    paysel:
   
    for each tDPaySel 
       where (tDPaySel.tc_status = "N" or tDPaySel.tc_status = "C")
         and tDPaySel.DPaySelStatus = {&DOCUMENTSTATUS-INIT} on error undo, throw:   
        <M-96 run AdditionalUpdatesDCollection  (output viFcReturnSuper (oiReturnStatus)) in BDPaymentSelection>
        if viFcReturnSuper < 0 or oiReturnStatus = 0 
        then assign oiReturnStatus = viFcReturnSuper.
        if viFcReturnSuper < 0 
        then leave paysel.
    end. /* end for each paysel */
    
    if can-find (first tDCollectionPaySel)
    then do:
        if viBDCollection7id = 0 or viBDCollection7id = ?
        then do:
            <I-82 {bFcStartAndOpenInstance
                 &ADD-TO-TRANSACTION   = "yes"
                 &CLASS                = "BDCollection"}>   
            assign vlBDCollectionWasStartedHere = true.
        end.
        else do:
            <I-43 {bFcOpenInstance
                 &CLASS           = "BDCollection"}>
        end.
        
        <M-65 run UpdateDCollection
           (input-output tDCollectionPaySel (tDCollectionsToUpdate), 
            input  vlBDCollectionWasStartedHere (ilClearData), 
            output viLocalReturn (oiReturnStatus)) in BDCollection>
         
        if viLocalReturn >= 0 and vlBDCollectionWasStartedHere
        then do:
                <M-28 run ValidateBCAndAdditionalUpdates  (output viLocalReturn (oiReturnStatus)) in BDCollection>
        end.
        
        <I-89 {bFcCloseInstance
             &CLASS           = "BDCollection"}>
        
        if viLocalReturn  < 0 or oiReturnStatus = 0 
        then assign oiReturnStatus = viLocalReturn.
        if oiReturnStatus < 0 then leave addupdates.
    end. /* collections to process */
end. /* end do add updates */

if oiReturnStatus < 0
then do:
    <M-64 run StopExternalInstances  (output viFcReturnSuper (oiReturnStatus)) in BDPaymentSelection>
    if viFcReturnSuper < 0 then assign oiReturnStatus = viFcReturnSuper.
    return.
end.