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
icSearchBy | input | character | Search By Receiver or Legal document (see the ERSPROCESSORINVGROUP preprocessor). |
icSupplierFrom | input | character | Filtering parameter: start value for the supplier codes. |
icSupplierTo | input | character | Filtering parameter: end value for the site codes. |
icLegalDocumentFrom | input | character | Filtering parameter: start value for the legal document number. |
icLegalDocumentTo | input | character | Filtering parameter: end value for the legal document number. |
icSiteFrom | input | character | Filtering parameter: start value for the site codes. |
icSiteTo | input | character | Filtering parameter: end value for the site codes. |
icReceiverFrom | input | character | Filtering parameter: start value for the receiver number. |
icReceiverTo | input | character | Filtering parameter: end value for the receiver number. |
itReceiptDateFrom | input | date | Filtering parameter: beginning date for the receipt date. |
itReceiptDateTo | input | date | Filtering parameter: ending date for the receipt date. |
itEffIssueDateFrom | input | date | Filtering parameter: beginning date for the effective issue date. |
itEffIssueDateTo | input | date | Filtering parameter: ending date for the effective issue date. |
tERSProcessorRef | output | temp-table | Output temp-table: holds the pending vouchers to be considered for ERS processing. |
tERSProcessorLogRef | output | temp-table | Output temp-table: logs status information for the pending vouchers that will be considered by the ERS processor. |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
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.