project QadFinancials > class BPeriod > method ValidateComponentPostConCheck

validation procedure

Description

this function is to call method of ValidateComponentPostConCheck in component BConCheck


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BPeriod.ValidateComponentPost


program code (program4/bperiod.p)

/* call method of BConCheck.ValidatecomponentPostConCheck */

assign vlBusinessExecuted  = false
       vlTechnicalExecuted = false
       vlRegionalExecuted  = false
       vlBusinessPass      = false
       vlTechnicalPass     = false
       vlRegionalPass      = false.
       
<Q-3 run ConCheckForMaxSeq (all) (Read) (NoCache)
   (input viCompanyId, (CompanyId)
    input t_sPeriod.Period_ID, (PeriodID)
    output dataset tqConCheckForMaxSeq) in BConCheck >
find first tqConCheckForMaxSeq no-error.
if available tqConCheckForMaxSeq
then assign viMaxConCheckSeq     = tqConCheckForMaxSeq.tiConCheckSeq
            vlConCheckIsUpToDate = tqConCheckForMaxSeq.tlConCheckIsUpToDate.
            
<Q-46 run ConCheckLineByConCheck (all) (Read) (NoCache)
   (input viCompanyId, (CompanyId)
    input ?, (ConCheckId)
    input t_sPeriod.Period_ID, (PeriodId)
    output dataset tqConCheckLineByConCheck) in BConCheck >
find first tqConCheckLineByConCheck
     where tqConCheckLineByConCheck.tcConCheckLineType = {&CONCHECKLINETYPE-BUSINESS}   and
           tqConCheckLineByConCheck.tcConCheckLineResult   <> {&CONCHECKRESULT-NOTEXECUTED} no-error.
if available tqConCheckLineByConCheck
then do:
    assign vlBusinessExecuted = true.
    if tqConCheckLineByConCheck.tcConCheckLineResult = {&CONCHECKRESULT-PASSED}
    then assign vlBusinessPass = true.
end.

find first tqConCheckLineByConCheck
     where tqConCheckLineByConCheck.tcConCheckLineType = {&CONCHECKLINETYPE-TECHNICAL}  and
           tqConCheckLineByConCheck.tcConCheckLineResult   <> {&CONCHECKRESULT-NOTEXECUTED} no-error.
if available tqConCheckLineByConCheck
then do:
    assign vlTechnicalExecuted = true.
    if tqConCheckLineByConCheck.tcConCheckLineResult = {&CONCHECKRESULT-PASSED}
    then assign vlTechnicalPass = true.
end.

find first tqConCheckLineByConCheck
     where tqConCheckLineByConCheck.tcConCheckLineType = {&CONCHECKLINETYPE-REGIONAL}   and
           tqConCheckLineByConCheck.tcConCheckLineResult   <> {&CONCHECKRESULT-NOTEXECUTED} no-error.
if available tqConCheckLineByConCheck
then do:
    assign vlRegionalExecuted = true.
    if tqConCheckLineByConCheck.tcConCheckLineResult = {&CONCHECKRESULT-PASSED}
    then assign vlRegionalPass = true.
end.

/* If no pass/fail records found of Technical, Business or Regional (option)*/
if vlBusinessExecuted  = false or
   vlRegionalExecuted  = false or
   vlTechnicalExecuted = false
then do:
    assign vcNotExeValidation = "":U.
    if vlBusinessExecuted = false
    then assign vcNotExeValidation = vcNotExeValidation + {&CONCHECKLINETYPE-BUSINESS-TR} + ', ':U.
    if vlRegionalExecuted = false
    then assign vcNotExeValidation = vcNotExeValidation + {&CONCHECKLINETYPE-REGIONAL-TR} + ', ':U.
    if vlTechnicalExecuted = false
    then assign vcNotExeValidation = vcNotExeValidation + {&CONCHECKLINETYPE-TECHNICAL-TR} + ', ':U.
    assign vcNotExeValidation = trim(vcNotExeValidation, ', ':U).
    
    <M-84 run SetMessage
       (input  trim(substitute(#T-31'The period cannot be reported. The following validations have not been executed: &1':255(74527636)T-31#, vcNotExeValidation)) (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'qadfin-629703':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output oiReturnStatus (oiReturnStatus)) in BPeriod>
    assign oiReturnStatus = -1.
    return.
end.

/* If finding failure record in lastest run, pop Warning but continue */
if vlBusinessPass  = false or
   vlRegionalPass  = false or
   vlTechnicalPass = false
then do:
    assign vcFailedValidation = "":U.
    if vlBusinessPass  = false
    then assign vcFailedValidation = vcFailedValidation + {&CONCHECKLINETYPE-BUSINESS-TR} + ', ':U.
    if vlRegionalPass  = false
    then assign vcFailedValidation = vcFailedValidation + {&CONCHECKLINETYPE-REGIONAL-TR} + ', ':U.
    if vlTechnicalPass = false
    then assign vcFailedValidation = vcFailedValidation + {&CONCHECKLINETYPE-TECHNICAL-TR} + ', ':U.
    assign vcFailedValidation = trim(vcFailedValidation , ', ':U).

    <M-57 run SetMessage
       (input  trim(substitute(#T-76'The following validations have failed for this period: &1':255(10290401)T-76#, vcFailedValidation)) (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'W':U (icType), 
        input  2 (iiSeverity), 
        input  '':U (icRowid), 
        input  'qadfin-856174':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output oiReturnStatus (oiReturnStatus)) in BPeriod>
    assign oiReturnStatus = 1.
end.

/* If batch flag.ConCheckIsUpToDate = false, pop Warning but continue */
if vlConCheckIsUpToDate = false
then do:
    <M-98 run SetMessage
       (input  trim(#T-81'The consistency check may be out of date for this period':255(341985660)T-81#) (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'W':U (icType), 
        input  2 (iiSeverity), 
        input  '':U (icRowid), 
        input  'qadfin-580598':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output oiReturnStatus (oiReturnStatus)) in BPeriod>
    assign oiReturnStatus = 1.
end.