project QadFinancials > class BFRWChart > method ValidateComponentAll

Description

This method is a submethod of ValidateComponent.

This method includes the validations that are done after the ancestor code of the ValidateComponent.
This method includes the validation of the frwchart and his sub-tables.


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BFRWChart.ValidateComponent


program code (program5/bfrwchart.p)

/* ====================================================================================== *
 * Method       : ValidateComponentAll                                                    *
 * Description  : Validate frwcube and all sub-tables                                     *
* ====================================================================================== */
 
MAIN_BLOCK:
do on error undo, throw:
    for each t_sFRWChart where t_sFRWChart.tc_Status <> "D":U:
    /* =============================================================================================================== */
    /* Validate frwcube for accounts                                                                                   */
    /* =============================================================================================================== */
        if t_sFRWChart.FRWChartDefaultGLCode <> '':U 
            and t_sFRWChart.FRWChartDefaultGLCode <> ?
        then do:
            <Q-21 run GLForFRWBySharedSet (all) (Read) (NoCache)
                        (input ?, (CompanyId)
                         input ?, (GLID)
                         input t_sFRWChart.FRWChartDefaultGLCode, (GLCode)
                         input t_sFRWChart.GLSharedSet_ID, (SharedSetID)
                         input ?, (SharedSetCode)
                         output dataset tqGLForFRWBySharedSet) in BGL>
            if not can-find (first tqGLForFRWBySharedSet)
            then do:
                assign vcMessage      = trim(#T-25'GL account does not exist in the Shared Set.':100(260553383)T-25#)
                       oiReturnStatus = -1.
                <M-27 run SetMessage
                   (input  vcMessage (icMessage), 
                    input  '':U (icArguments), 
                    input  'FRWChart.FRWChartDefaultGLCode':U (icFieldName), 
                    input  t_sFRWChart.FRWChartDefaultGLCode (icFieldValue), 
                    input  'E':U (icType), 
                    input  3 (iiSeverity), 
                    input  '':U (icRowid), 
                    input  'qadfin-873372':U (icFcMsgNumber), 
                    input  '':U (icFcExplanation), 
                    input  '':U (icFcIdentification), 
                    input  '':U (icFcContext), 
                    output viFcReturnSuper (oiReturnStatus)) in BFRWChart>  
            end.
        end. /* End default GL code */
        if t_sFRWChart.FRWChartCurrTransAdjGLCode <> '':U 
            and t_sFRWChart.FRWChartCurrTransAdjGLCode <> ?
        then do:
            <Q-51 run GLForFRWBySharedSet (all) (Read) (NoCache)
                (input ?, (CompanyId)
                 input ?, (GLID)
                 input t_sFRWChart.FRWChartCurrTransAdjGLCode, (GLCode)
                 input t_sFRWChart.GLSharedSet_ID, (SharedSetID)
                 input ?, (SharedSetCode)
                 output dataset tqGLForFRWBySharedSet) in BGL>
            find first tqGLForFRWBySharedSet no-error.
            if not available tqGLForFRWBySharedSet 
            then do:
                assign vcMessage      = trim(#T-1'CTA GL account does not exist in the reporting domain.':100(957893347)T-1#)
                       oiReturnStatus = -1.
                <M-82 run SetMessage
                   (input  vcMessage (icMessage), 
                    input  '':U (icArguments), 
                    input  'FRWChart.FRWChartCurrTransAdjGLCode':U (icFieldName), 
                    input  t_sFRWChart.FRWChartCurrTransAdjGLCode (icFieldValue), 
                    input  'E':U (icType), 
                    input  3 (iiSeverity), 
                    input  '':U (icRowid), 
                    input  'qadfin-191803':U (icFcMsgNumber), 
                    input  '':U (icFcExplanation), 
                    input  '':U (icFcIdentification), 
                    input  '':U (icFcContext), 
                    output viFcReturnSuper (oiReturnStatus)) in BFRWChart>  .
            end.
            else do:
                <Q-28 run PostingLineByGL (first) (Read) (NoCache)
                   (input ?, (CompanyId)
                    input tqGLForFRWBySharedSet.tiGL_ID, (GLId)
                    input ?, (PostingIsClosed)
                    output dataset tqPostingLineByGL) in BPosting>
                if can-find (first tqPostingLineByGL)
                then do:
                     assign vcMessage = trim(#T-66'Unable to use this CTA Account. There must be no transaction posted on CTA account.':200(106163467)T-66#)
                            oiReturnStatus = -1.
                     <M-8 run SetMessage
                        (input  vcMessage (icMessage), 
                         input  '':U (icArguments), 
                         input  'FRWChart.FRWChartCurrTransAdjGLCode':U (icFieldName), 
                         input  t_sFRWChart.FRWChartCurrTransAdjGLCode (icFieldValue), 
                         input  'E':U (icType), 
                         input  3 (iiSeverity), 
                         input  '':U (icRowid), 
                         input  'qadfin-551484':U (icFcMsgNumber), 
                         input  '':U (icFcExplanation), 
                         input  '':U (icFcIdentification), 
                         input  '':U (icFcContext), 
                         output viFcReturnSuper (oiReturnStatus)) in BFRWChart>  
                        
                end.
            end.
        end. /* End default CTA GL code */
        if t_sFRWChart.FRWChartDefaultCCCode <> '':U 
            and t_sFRWChart.FRWChartDefaultCCCode <> ?
        then do:
            <Q-40 run CostCenterForFRWBySharedSet (all) (Read) (NoCache)
               (input ?, (CompanyId)
                input ?, (CostCentreID)
                input t_sFRWChart.FRWChartDefaultCCCode, (CostCentreCode)
                input t_sFRWChart.CostCentreSharedSet_ID, (SharedSetID)
                input ?, (SharedSetCode)
                output dataset tqCostCenterForFRWBySharedSet) in BCostCentre>
            if not can-find (first tqCostCenterForFRWBySharedSet)
            then do:
                assign vcMessage      = trim(#T-77'Cost Center does not exist in the Shared Set.':100(126214700)T-77#)
                       oiReturnStatus = -1.
                <M-32 run SetMessage
                   (input  vcMessage (icMessage), 
                    input  '':U (icArguments), 
                    input  'FRWChart.FRWChartDefaultCCCode':U (icFieldName), 
                    input  t_sFRWChart.FRWChartDefaultCCCode (icFieldValue), 
                    input  'E':U (icType), 
                    input  3 (iiSeverity), 
                    input  '':U (icRowid), 
                    input  'qadfin-484500':U (icFcMsgNumber), 
                    input  '':U (icFcExplanation), 
                    input  '':U (icFcIdentification), 
                    input  '':U (icFcContext), 
                    output viFcReturnSuper (oiReturnStatus)) in BFRWChart>  
            end.
        end. /* End default Cost Centre code */
        if t_sFRWChart.FRWChartDefaultPrjCode <> '':U 
            and t_sFRWChart.FRWChartDefaultPrjCode <> ?
        then do:
            <Q-69 run ProjectForFRWBySharedSet (all) (Read) (NoCache)
                    (input ?, (CompanyId)
                     input ?, (ProjectID)
                     input t_sFRWChart.FRWChartDefaultPrjCode, (ProjectCode)
                     input t_sFRWChart.ProjectSharedSet_ID, (SharedSetID)
                     input ?, (SharedSetCode)
                     output dataset tqProjectForFRWBySharedSet) in BProject>
            if not can-find (first tqProjectForFRWBySharedSet)
            then do:
                assign vcMessage      = trim(#T-22'Project does not exist in the Shared Set.':100(326546273)T-22#)
                       oiReturnStatus = -1.
                <M-57 run SetMessage
                   (input  vcMessage (icMessage), 
                    input  '':U (icArguments), 
                    input  'FRWChart.FRWChartDefaultPrjCode':U (icFieldName), 
                    input  t_sFRWChart.FRWChartDefaultPrjCode (icFieldValue), 
                    input  'E':U (icType), 
                    input  3 (iiSeverity), 
                    input  '':U (icRowid), 
                    input  'qadfin-298518':U (icFcMsgNumber), 
                    input  '':U (icFcExplanation), 
                    input  '':U (icFcIdentification), 
                    input  '':U (icFcContext), 
                    output viFcReturnSuper (oiReturnStatus)) in BFRWChart>  
            end.
        end. /* End default Project code */
        if t_sFRWChart.FRWChartDefaultDivCode <> '':U 
            and t_sFRWChart.FRWChartDefaultDivCode <> ?
        then do:

         <Q-49 run DivisionForFRWBySharedSet (all) (Read) (NoCache)
            (input ?, (CompanyId)
             input ?, (DivisionID)
             input t_sFRWChart.FRWChartDefaultDivCode, (DivisionCode)
             input t_sFRWChart.DivisionSharedSet_ID, (SharedSetID)
             input ?, (SharedSetCode)
             output dataset tqDivisionForFRWBySharedSet) in BDivision>   
            if not can-find (first tqDivisionForFRWBySharedSet)
            then do:
                assign vcMessage      = trim(#T-91'Sub-Account does not exist in the Shared Set.':100(639314)T-91#)
                       oiReturnStatus = -1.
                <M-83 run SetMessage
                   (input  vcMessage (icMessage), 
                    input  '':U (icArguments), 
                    input  'FRWChart.FRWChartDefaultDivCode':U (icFieldName), 
                    input  t_sFRWChart.FRWChartDefaultDivCode (icFieldValue), 
                    input  'E':U (icType), 
                    input  3 (iiSeverity), 
                    input  '':U (icRowid), 
                    input  'qadfin-682361':U (icFcMsgNumber), 
                    input  '':U (icFcExplanation), 
                    input  '':U (icFcIdentification), 
                    input  '':U (icFcContext), 
                    output viFcReturnSuper (oiReturnStatus)) in BFRWChart> 
            end.
        end. /* End default DIVISION code */

        
    /* =============================================================================================================== */
    /* Call a submethod that validate frwcube for shared codes                                                        */
    /* =============================================================================================================== */
        <M-58 run ValidateComponentAllSharedSets  (output viFcReturnSuper (oiReturnStatus)) in BFRWChart>    
        if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0) 
        then assign oiReturnStatus = viFcReturnSuper.
        
    /* =============================================================================================================== */
    /* Call a submethod that validate frwcube for saf concepts                                                         */
    /* =============================================================================================================== */
        <M-64 run ValidateComponentAllSafConcepts  (output viFcReturnSuper (oiReturnStatus)) in BFRWChart>
        if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0) 
        then assign oiReturnStatus = viFcReturnSuper.
        
    /* =============================================================================================================== */
    /* Call a submethod that validate frwcube for entities                                                             */
    /* =============================================================================================================== */
       <M-13 run ValidateComponentAllEntities  (output viFcReturnSuper (oiReturnStatus)) in BFRWChart>

        if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0) then assign oiReturnStatus = viFcReturnSuper.
        if viFcReturnSuper < 0 then leave MAIN_BLOCK.           

    /* =============================================================================================================== */
    /* Call a submethod that validate frwcube for coa cross ref                                                        */
    /* =============================================================================================================== */
        <M-14 run InitializeFRWXref  (output viFcReturnSuper (oiReturnStatus)) in BFRWChart>
        if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0) then assign oiReturnStatus = viFcReturnSuper.
        if viFcReturnSuper < 0 then leave MAIN_BLOCK. 

       <M-37 run ValidateComponentAllCOACrossRef  (output viFcReturnSuper (oiReturnStatus)) in BFRWChart>
        if viFcReturnSuper < 0 or (viFcReturnSuper > 0 and oiReturnStatus = 0) then assign oiReturnStatus = viFcReturnSuper.
        if viFcReturnSuper < 0 then leave MAIN_BLOCK.      
    end. /*  for each t_sFRWCube  */
end. /* MAIN_BLOCK */