project QadFinancials > class BFixedAssetDepreciation > method PostValidateComponent

Description

Performs Validations after ancestor of the ValidateComponent


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BFixedAssetDepreciation.ValidateComponent


program code (program1/bfixedassetdepreciation.p)

/*
/* Validates all New and Changed Employees */
for each t_sFADepreciationDet:
    if t_sFADepreciationDet.tc_Status <> 'N':U and
       t_sFADepreciationDet.tc_Status <> 'C':U and
       not can-find(first t_sFADepreciationDetSaf where
                          t_sFADepreciationDetSaf.tc_ParentRowid = t_sFADepreciationDet.tc_Rowid and
                         (t_sFADepreciationDetSaf.tc_Status      = 'N':U or
                          t_sFADepreciationDetSaf.tc_Status      = 'C':U))
    then next.

    /* Safs */
    if can-find(first t_sFADepreciationDetSaf where
                      t_sFADepreciationDetSaf.tc_ParentRowid = t_sEmployee.tc_Rowid and
                     (t_sFADepreciationDetSaf.tc_Status      = 'N':U or
                      t_sFADepreciationDetSaf.tc_Status      = 'C':U))
    then do:
    /* Saf Code vs Saf Concept */
        <Q-1 run SafPrim (Start) in BSaf >
        
        for each t_sFADepreciationDetSaf where
                 t_sFADepreciationDetSaf.tc_ParentRowid = t_sEmployee.tc_Rowid and
                (t_sFADepreciationDetSaf.tc_Status = 'N':U or
                 t_sFADepreciationDetSaf.tc_Status = 'C':U):

            if t_sFADepreciationDetSaf.Saf_ID = -1
            then assign t_sFADepreciationDetSaf.Saf_ID = ?.

            if t_sFADepreciationDetSaf.Saf_ID <> 0 and
               t_sFADepreciationDetSaf.Saf_ID <> ?
            then do:
                <Q-2 run SafPrim (all) (Read) (Cache)
          (input t_sFADepreciationDetSaf.Saf_ID, (SafID)
           input t_sFADepreciationDetSaf.tcSafCode, (SafCode)
           input ?, (SafConceptCode)
           output dataset tqSafPrim) in BSaf >
        
                find first tqSafPrim where
                           tqSafPrim.tcSafCode        = t_sFADepreciationDetSaf.tcSafCode and
                           tqSafPrim.tcSafConceptCode = t_sFADepreciationDetSaf.tcSafConceptCode
                           no-error.
                if not available tqSafPrim
                then do:
                    assign vcMessage = trim(substitute('The Saf Value &3 does not belong to the Saf Concept &2. (Posting Description: &1)':L200, trim(t_sFADepreciationDet.FADepreciationDetPostingDescr), trim(string(t_sFADepreciationDetSaf.tcSafConceptCode)), trim(string(t_sFADepreciationDetSaf.tcSafCode)))).
                    <M-5 run SetMessage (input  vcMessage (icMessage),
                     input  '':U (icArguments),
                     input  't_FADepreciationDetSaf.tcSafCode':U (icFieldName),
                     input  string(t_sFADepreciationDetSaf.tcSafCode) (icFieldValue),
                     input  'E':U (icType),
                     input  3 (iiSeverity),
                     input  t_sFADepreciationDet.tc_Rowid (icRowid),
                     input  'QADFIN-2900':U (icFcMsgNumber),
                     input  '' (icFcExplanation),
                     input  '' (icFcIdentification),
                     input  '' (icFcContext),
                     output viFcReturnSuper (oiReturnStatus)) in BFixedAssetDepreciation>
                    assign oiReturnStatus = min(-1, viFcReturnSuper).
                end.
            end.
        end.
        
        <Q-4 run SafPrim (Stop) in BSaf >
    end.
end. 
*/