project QadFinancials > class BERSProcessor > method GetERSPendingVouchers

Description

Method to find and return the pending voucher records that the ERS processor should consider for processing. The pending voucher list will depend on the filter criteria speficied by the user. The method will call different sub-methods depending on whether or not fiscal receiving (legal documents) is being used.


Parameters


icSearchByinputcharacterSearch By Receiver or Legal document (see the ERSPROCESSORINVGROUP preprocessor).
icSupplierFrominputcharacterFiltering parameter: start value for the supplier codes.
icSupplierToinputcharacterFiltering parameter: end value for the site codes.
icLegalDocumentFrominputcharacterFiltering parameter: start value for the legal document number.
icLegalDocumentToinputcharacterFiltering parameter: end value for the legal document number.
icSiteFrominputcharacterFiltering parameter: start value for the site codes.
icSiteToinputcharacterFiltering parameter: end value for the site codes.
icReceiverFrominputcharacterFiltering parameter: start value for the receiver number.
icReceiverToinputcharacterFiltering parameter: end value for the receiver number.
itReceiptDateFrominputdateFiltering parameter: beginning date for the receipt date.
itReceiptDateToinputdateFiltering parameter: ending date for the receipt date.
itEffIssueDateFrominputdateFiltering parameter: beginning date for the effective issue date.
itEffIssueDateToinputdateFiltering parameter: ending date for the effective issue date.
tERSProcessorRefoutputtemp-tableOutput temp-table: holds the pending vouchers to be considered for ERS processing.
tERSProcessorLogRefoutputtemp-tableOutput temp-table: logs status information for the pending vouchers that will be considered by the ERS processor.
oiReturnStatusoutputintegerReturn status of the method.


Internal usage


QadFinancials
method BERSProcessor.ERSProcessBatch


program code (program5/bersprocessor.p)

/* =================================================================================================== */
/* Method      : GetERSPendingVouchers                                                                 */
/* Desc        : This method quieries database for pending vouchers which are ERS enabled. These       */
/*               pending vouchers are used for ERS processing.                                         */
/*               Supported types: Normal purchase order receipt                                        */
/*                                Purchase ledger invoice                                              */
/* --------------------------------------------------------------------------------------------------- */
/* Params:  (I)  SearchBy             Option to define whether search by Receivers/Legal documents     */
/*          (I)  SupplierFrom         Suppleir code from (filtering parameter)                         */
/*          (I)  SupplierTo           Supplier code to (filtering parameter)                           */
/*          (I)  LegalDocumentFrom    Legal document from (filtering parameter)                        */
/*          (I)  LegalDocumentTo      Legal document to (filtering parameter)                          */
/*          (I)  SiteFrom             Site from (filtering parameter)                                  */
/*          (I)  SiteTo               Site to (filtering parameter)                                    */
/*          (I)  ReceiverFrom         Receiver number from (filtering parameter)                       */
/*          (I)  ReceiverTo           Receiver number to (filtering parameter)                         */
/*          (I)  ReceiptDateFrom      Receipt date from (filtering parameter)                          */
/*          (I)  ReceiptDateTo        Receipt date to (filtering parameter)                            */
/*          (O)  tERSProcessorRef     Quieried pending voucher(s) ready for ERS processing             */
/* =================================================================================================== */

assign oiReturnStatus = -98.

/* =================================================================================================== */
/* Check the mode that the ERS processor is being run in, then run the appropriate method.             */
/* =================================================================================================== */

if icSearchBy = {&ERSPROCESSORINVGROUP-RECEIVER}
then do:

    <M-71 run GetERSPendingVouchersPORec
       (input  icSupplierFrom (icSupplierFrom), 
        input  icSupplierTo (icSupplierTo), 
        input  icSiteFrom (icSiteFrom), 
        input  icSiteTo (icSiteTo), 
        input  icReceiverFrom (icReceiverFrom), 
        input  icReceiverTo (icReceiverTo), 
        input  itReceiptDateFrom (itReceiptDateFrom), 
        input  itReceiptDateTo (itReceiptDateTo), 
        output tERSProcessorRef (tERSProcessorRef), 
        output tERSProcessorLogRef (tERSProcessorLogRef), 
        output viFcReturnSuper (oiReturnStatus)) in BERSProcessor>

    if viFcReturnSuper <> 0
    then do:
        Assign oiReturnStatus = -1
               vcMessage      = trim(#T-19'Error during execution of the ERS Processor (Non-fiscal receiving): see other messages for details.':255(763943735)T-19#).
        <M-7 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-467294':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BERSProcessor>
    end.

end. /* if icSearchBy .....*/
else if icSearchBy = {&ERSPROCESSORINVGROUP-LEGALDOC}
then do:

    <M-25 run GetERSLegalDocuments
       (input  icSupplierFrom (icSupplierFrom), 
        input  icSupplierTo (icSupplierTo), 
        input  icLegalDocumentFrom (icLegalDocumentFrom), 
        input  icLegalDocumentTo (icLegalDocumentTo), 
        input  icSiteFrom (icSiteFrom), 
        input  icSiteTo (icSiteTo), 
        input  icReceiverFrom (icReceiverFrom), 
        input  icReceiverTo (icReceiverTo), 
        input  itReceiptDateFrom (itReceiptDateFrom), 
        input  itReceiptDateTo (itReceiptDateTo), 
        input  itEffIssueDateFrom (itEffIssueDateFrom), 
        input  itEffIssueDateTo (itEffIssueDateTo), 
        output tERSProcessorRef (tERSProcessorRef), 
        output tERSProcessorLogRef (tERSProcessorLogRef), 
        output viFcReturnSuper (oiReturnStatus)) in BERSProcessor>
     
        
    if viFcReturnSuper <> 0
    then do:
        Assign oiReturnStatus = -1
               vcMessage      = trim(#T-74'Error during execution of the ERS Processor (Fiscal receiving): see other messages for details.':255(339206571)T-74#).
        <M-34 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-374543':U (icFcMsgNumber), 
            input  '':U (icFcExplanation), 
            input  '':U (icFcIdentification), 
            input  '':U (icFcContext), 
            output viFcReturnSuper (oiReturnStatus)) in BERSProcessor>
    end.
        

end. /* if icSearchBy .... */
else do:
    assign oiReturnStatus = -1
           vcmessage      = trim(#T-23'Unknown ERS Processor Mode':255(659461432)T-23#).
    <M-56 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-585147':U (icFcMsgNumber), 
        input  '':U (icFcExplanation), 
        input  '':U (icFcIdentification), 
        input  '':U (icFcContext), 
        output viFcReturnSuper (oiReturnStatus)) in BERSProcessor>
end.


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