Description
Update pending vouchers
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program5/bersprocessor.p)
/* =================================================================================================== */
/* Method : ERSProcessFinishPvo */
/* Desc : Mark those receipts which failed during ERS processing to be excluded next time */
/* --------------------------------------------------------------------------------------------------- */
/* =================================================================================================== */
/* =================================================================================================== *
* Precondition *
* =================================================================================================== */
if not vlIsCreateCIAndAPMatching
then return.
assign oiReturnStatus = -98
viLocalReturn = 0.
/* =================================================================================================== *
* Create list of pending vouchers to be updated *
* =================================================================================================== */
empty temp-table tPvoERSUpdateERSP.
assign vlIsI19opr-br-mfgPackageInst = false.
for each tERSProcessorRef where
tERSProcessorRef.tiERSStatus = {&PVO_ERS_STATUS_ERROR} or
tERSProcessorRef.tiERSStatus = {&PVO_ERS_STATUS_INVOICED} or
tERSProcessorRef.tiERSStatus = {&PVO_ERS_STATUS_ERROR_PROCESS}:
create tPvoERSUpdateERSP.
assign tPvoERSUpdateERSP.tcPvoDomain = tERSProcessorRef.tcDomainCode
tPvoERSUpdateERSP.tiPvoID = tERSProcessorRef.tiPvoId
tPvoERSUpdateERSP.tiERSStatus = if tERSProcessorRef.tiERSStatus = {&PVO_ERS_STATUS_ERROR_PROCESS}
then {&PVO_ERS_STATUS_ERROR}
else tERSProcessorRef.tiERSStatus
vlIsI19opr-br-mfgPackageInst = vlIsI19opr-br-mfgPackageInst or
(tERSProcessorRef.tcLegalDocType <> ? and
tERSProcessorRef.tcLegalDocType <> "":U).
end. /* for each tERSProcessorRef where */
if not can-find(first tPvoERSUpdateERSP)
then do:
assign oiReturnStatus = 0.
return.
end.
/* =================================================================================================== *
* Does real execution *
* =================================================================================================== */
if vcGroupBy = {&ERSPROCESSORINVGROUP-LEGALDOC} and
vlIsI19opr-br-mfgPackageInst = true /* there is installed Operational package for Brazilien customers i19opr-br-mfg */
then do:
<I-30 {bFcStartAndOpenInstance
&CLASS = "PMFGPendingVoucher"}>
<M-80 run UpdatePvoMstr
(input tPvoERSUpdateERSP (tUpdatePvoMstr),
output viFcReturnSuper (oiReturnStatus)) in PMFGPendingVoucher>
if viFcReturnSuper < 0 or
viFcReturnSuper > 0 and viLocalReturn = 0
then assign viLocalReturn = viFcReturnSuper.
<I-36 {bFcCloseInstance
&CLASS = "PMFGPendingVoucher"}>
end.
else do:
<I-1 {bFcStartAndOpenInstance
&ADD-TO-TRANSACTION = "true"
&CLASS = "BMfgPendingVoucher"}>
<M-5 run UpdatePendingVoucherFromERS
(input tPvoERSUpdateERSP (tPvoERSUpdate),
output viFcReturnSuper (oiReturnStatus)) in BMfgPendingVoucher>
if viFcReturnSuper < 0 or
viFcReturnSuper > 0 and viLocalReturn = 0
then assign viLocalReturn = viFcReturnSuper.
if viLocalReturn >= 0
then do:
<M-7 run ValidateBCAndAdditionalUpdates (output viFcReturnSuper (oiReturnStatus)) in BMfgPendingVoucher>
if viFcReturnSuper < 0 or
viFcReturnSuper > 0 and viLocalReturn = 0
then assign viLocalReturn = viFcReturnSuper.
end.
<I-6 {bFcCloseInstance
&CLASS = "BMfgPendingVoucher"}>
end.
/* =================================================================================================== */
/* Return */
/* =================================================================================================== */
assign oiReturnStatus = viLocalReturn.