Description
Update next pre-printed number of bank payment format.
Parameters
iiBankPayFormatID | input | integer | |
iiNewPrePrintedNumber | input | integer | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bbankpayformat.p)
assign oiReturnStatus = -98.
/* Valid that the input BankPayFormatID is not blank */
if iiBankPayFormatID = ?
then do:
assign vcMessage = #T-9'The bank payment format is blank.':255(65756)t-9#.
<M-8 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-7464':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBankPayFormat>
assign oiReturnStatus = -1.
return.
end.
/* If the input NewPrePrintedNumber is ?, don't do any updates */
if iiNewPrePrintedNumber = ? then return.
/* Valid existence of the bank payment format */
<Q-1 run BankPayFormatPrim (all) (Read) (NoCache)
(input ?, (BankNumberId)
input iiBankPayFormatID, (BankPayFormatId)
input ?, (PayFormatTypeCode)
output dataset tqBankPayFormatPrim) in BBankPayFormat >
find first tqBankPayFormatPrim no-error.
if not available tqBankPayFormatPrim
then do:
assign vcMessage = #T-4'Invalid bank payment format.':255(65757)T-4#.
<M-2 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-7462':U (icFcMsgNumber),
input '':U (icFcExplanation),
input '':U (icFcIdentification),
input '':U (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BBankPayFormat>
assign oiReturnStatus = -1.
return.
end.
/* Load data and assign new value of the next pre-printed number for current bank payment format */
<M-3 run DataLoad
(input ? (icRowids),
input string(iiBankPayFormatID) (icPkeys),
input ? (icObjectIds),
input ? (icFreeform),
input false (ilKeepPrevious),
output viFcReturnSuper (oiReturnStatus)) in BBankPayFormat>
if viFcReturnSuper <> 0 then assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0 then return.
find first tBankPayFormat where
tBankPayFormat.BankPayFormat_ID = iiBankPayFormatID no-error.
if available tBankPayFormat then do:
assign
tBankPayFormat.BankPayFormatNextCheckNbr = iiNewPrePrintedNumber.
tBankPayFormat.tc_Status = 'C':U.
end.
/* Save changes of the modification */
<M-5 run ValidateBC (output viFcReturnSuper (oiReturnStatus)) in BBankPayFormat>
if viFcReturnSuper <> 0 then assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0 then return.
<M-6 run AdditionalUpdates (output viFcReturnSuper (oiReturnStatus)) in BBankPayFormat>
if viFcReturnSuper <> 0 then assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0 then return.
<M-7 run DataSave (output viFcReturnSuper (oiReturnStatus)) in BBankPayFormat>
if viFcReturnSuper <> 0 then assign oiReturnStatus = viFcReturnSuper.
if viFcReturnSuper < 0 then return.
if oiReturnStatus = -98 then assign oiReturnStatus = 0.