project QadFinancials > class BBudget > method BudgetVersionRollUpAmountsGLFig

Description

This method is the submehtod of BudgetVersionRollUpAmounts because it could not hold all the code.


Parameters


icBudgetVersionTcRowidinputcharacterBudgetVersionTcRowid
tNewBudgetVersionGLFiginput-outputtemp-tabletNewBudgetVersionGLFig
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BBudget.BudgetVersionRollUpAmounts


program code (program6/bbudget.p)

/* ======================================================================================== */
/* Reset the amounts for nodes that do have childs                                          */
/* ======================================================================================== */
assign vhtable = BUFFER tNewBudgetVersionGLFig:HANDLE.
for each tNewBudgetVersionGLFig where 
         tNewBudgetVersionGLFig.tc_ParentRowid  = icBudgetVersionTcRowid and 
         tNewBudgetVersionGLFig.tc_status      <> "D":U :
    /* reset all values of nodes that are different than level defined on budget (for the specific type)*/
    if tNewBudgetVersionGLFig.tiBudgetFDSSeq <> tBudget.BudgetInputLevelBudget and
       can-find(first btNewBudgetVersionGLFig where btNewBudgetVersionGLFig.tc_ParentRowid  = icBudgetVersionTcRowid and
                                                    btNewBudgetVersionGLFig.tc_status      <> "D":U                  and
                                                    btNewBudgetVersionGLFig.tiParentBudgetWBS_ID    = tNewBudgetVersionGLFig.BudgetWBS_ID)
    then do viweeks = 1 TO 54: /* same fields only number is different */
        assign vhtable:buffer-field("BudgetVersionGLFig":U + string(viweeks,"99":U) + "TC":U):buffer-value     = 0
               vhtable:buffer-field("BudgetVersionGLFig":U + string(viweeks,"99":U) + "QTY":U):buffer-value    = 0
               vhtable:buffer-field("BudgetVersionGLFig":U + string(viweeks,"99":U) + "EACTC":U):buffer-value  = 0
               vhtable:buffer-field("BudgetVersionGLFig":U + string(viweeks,"99":U) + "EACQTY":U):buffer-value = 0.
    end.
end. /* for each tNewBudgetVersionGLFig where  */  
delete object vhtable.

/* ======================================================================================== */
/* Go through all GL-Figures that are located on the bottom-nodes (they have no childs)     */
/* and add the amount of these nodes to all parent-nodes of the bottom-node.                */
/* ======================================================================================== */
/* Go though all parents of the bottom-node and update the figures of these nodes */
<M-2 run BudgetVersionRollUpAmountsGLFigSub (input  icBudgetVersionTcRowid (icBudgetVersionTcRowid), 
                                             output oiReturnStatus (oiReturnStatus)) in BBudget>