project QadFinancials > class BBudget > method AdditionalUpdates

Description

This method allows to do additional updates on class temp-tables after records were received (and validated) from outside, using method SetPublicTables.
You can start instances of other business classes to do those updates.


Parameters


oiReturnStatusoutputinteger


Internal usage


QadFinancials
method BBudget.ApiCopyBudget
method BBudget.UpdateBudgetCompanyFromChart


program code (program/bbudget.p)

/* ================================================================================ */
    /* A budget can only have 1 active version / Link to report-period should be unique */
    /* ================================================================================ */
    <M-8 run AdditionalUpdValBudgetVersion (output viFcReturnSuper (oiReturnStatus)) in BBudget>
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0)
    then assign oiReturnStatus = viFcReturnSuper.
    
    /* ==================================================================== */
    /* Check on the VersionFigures;                                         */
    /*  - GL-budgets (no Prj, no CC) can only use table BudgetVersionGLFig  */
    /*  - Other-budgets (Prj or CC) can only use table BudgetVersionFigure  */
    /* ==================================================================== */
    <M-11 run AdditionalUpdValBudgetVersionFig (output viFcReturnSuper (oiReturnStatus)) in BBudget>
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0)
    then assign oiReturnStatus = viFcReturnSuper.
    
    /* ===================================== */
    /* Check the FDS-structure of the budget */
    /* ===================================== */
    <M-5 run AdditionalUpdValBudgetFDS (output viFcReturnSuper (oiReturnStatus)) in BBudget>
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0)
    then assign oiReturnStatus = viFcReturnSuper.
    
    /* ========================================================== */
    /* Check the link BudgetWBS - BudgetWBSItem                   */
    /* BudgetWSBRosterDate should be unique within the BudgetWBS. */
    /* ========================================================== */
    <M-14 run AdditionalUpdValBudgetWBSItemRoster (output viFcReturnSuper (oiReturnStatus)) in BBudget>
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0)
    then assign oiReturnStatus = viFcReturnSuper.
    
    /* =============================================================================== */
    /* Check the FDS-structure of the budget                                           */
    /* Check for FDS-overlap on the budget (depending on system- and comapny-settings) */
    /* If Budget is Cy-dep and cy-settings = true then perform the test                */
    /* If Budgte is cy-indep and system-setting = true then perform the test           */
    /* =============================================================================== */
    <M-12 run AdditionalUpdValBudgetFDS (output viFcReturnSuper (oiReturnStatus)) in BBudget>
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0)
    then assign oiReturnStatus = viFcReturnSuper.
    if viFcReturnSuper >= 0 
    then do :
        <M-9 run AdditionalUpdValBudgetFDSOverlap (output viFcReturnSuper (oiReturnStatus)) in BBudget>
    end. /* if viFcReturnSuper >= 0 */
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0)
    then assign oiReturnStatus = viFcReturnSuper.
    
    /* ==================================================================== */
    /* Return in case error were detected                                   */
    /* ==================================================================== */
    if oiReturnStatus < 0 then return.
  
    
<ANCESTOR-CODE>
    
    
    /* ===================================================================== */
    /* Here we start the updates towards other components. If something goes */
    /* wrong from here onwards then we have to call StopExternalInstances.   */
    /* ===================================================================== */
    <M-15 run AdditionalUpdCreateSafStructureLink (output viFcReturnSuper (oiReturnStatus)) in BBudget>
    if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0)
    then assign oiReturnStatus = viFcReturnSuper.
    if oiReturnStatus < 0 
    then do :
        <M-17 run StopExternalInstances
           (output viFcReturnSuper (oiReturnStatus)) in BBudget>
        return.
    end. /* if oiReturnStatus < 0  */