project QadFinancials > class BERSProcessor > method ERSProcessInitValidateAll

Description

Validate all selected receipts


Parameters


oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BERSProcessor.ERSProcessInit


program code (program5/bersprocessor.p)

/* =================================================================================================== */
/* Method      : ERSProcessInitValidateAll                                                             */
/* Desc        : Validate all selected receipts whether ERS processing can be done for them            */
/* --------------------------------------------------------------------------------------------------- */
/* =================================================================================================== */

assign oiReturnStatus = -98.

/* =================================================================================================== */
/* Is there any record to be processed?                                                                */
/* =================================================================================================== */
if not can-find(first tERSProcessorRef where
                      tERSProcessorRef.tlIsSelected  = true and
                      tERSProcessorRef.tlIsProcessed = false)
then do:
    assign vcMessage = #T-2'You have not selected a transaction for processing. To process waiting receipts, you must add them to the grid and select them.':255(70282)t-2#.
    <M-1 run SetMessage
       (input  vcMessage (icMessage), 
        input  '':U (icArguments), 
        input  '':U (icFieldName), 
        input  '':U (icFieldValue), 
        input  'E':U (icType), 
        input  3 (iiSeverity), 
        input  '':U (icRowid), 
        input  'QadFin-8311':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BERSProcessor>
    assign oiReturnStatus = -1.
    return.
end.

/* =================================================================================================== */
/* Delete all errors/warnings raised last time                                                         */
/* =================================================================================================== */
empty temp-table tERSProcessorLogRef.

/* =================================================================================================== */
/* Go through all records to be processed                                                              */
/* =================================================================================================== */
for each tERSProcessorRef:

    if tERSProcessorRef.tlIsProcessed = true
    then do:
        delete tERSProcessorRef.                      
        next.
    end.
                      
    /* Automatically exclude those receipts which was not selected or was already processed */
    if tERSProcessorRef.tcLegalDocNbr <> ?    and
       tERSProcessorRef.tcLegalDocNbr <> "":U and
       can-find(first bERSProcessorRef where
                      bERSProcessorRef.tcDomainCode         = tERSProcessorRef.tcDomainCode         and
                      bERSProcessorRef.tcLegalDocNbr        = tERSProcessorRef.tcLegalDocNbr        and
                      bERSProcessorRef.ttEffectiveIssueDate = tERSProcessorRef.ttEffectiveIssueDate and
                      bERSProcessorRef.tlIsSelected         = true                                  and
                      bERSProcessorRef.tlIsProcessed        = false)
    then next.
                      
    if tERSProcessorRef.tlIsSelected <> true
    then do:
        delete tERSProcessorRef.
        next.
    end.
end.

/* =================================================================================================== */
/* Return                                                                                              */
/* =================================================================================================== */
if oiReturnStatus = -98 then assign oiReturnStatus = 0.