Description
Changes the status of the passed in payment selection - supported status are confirm or unconfirm.
Parameters
icActivityCode | input | character | |
icPaymentSelectionCode | input | character | |
icPostingJournal | input | character | |
iiPostingPeriod | input | integer | |
iiPostingYear | input | integer | |
itExecutionDate | input | date | |
itPostingDate | input | date | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bpaymentselection.p)
<M-28 run ValidateSelectionCodeForConfirm
(input icPaymentSelectionCode (icSelectionCode),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
if viFcReturnSuper <> 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then return.
if (icActivityCode <> {&PAYMENTSELECTIONACTIVITY-REGISTER} and
icActivityCode <> {&PAYMENTSELECTIONACTIVITY-UNCONFIRM})
then do:
assign
vcMessage = trim(substitute(#T-18'Activity code &1 is not supported.':255(743756959)T-18#,icActivityCode)).
oiReturnStatus = -1.
<M-6 run SetMessage
(input vcMessage (icMessage),
input '' (icArguments),
input '' (icFieldName),
input icPaymentSelectionCode (icFieldValue),
input '':U (icType),
input 2 (iiSeverity),
input '' (icRowid),
input 'qadfin-265817':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output oiReturnStatus (oiReturnStatus)) in BPaymentSelection>
end.
/* Set the activity code */
assign vcActivityCode = icActivityCode.
/* Get the ID */
<Q-42 run PaySelPrim (all) (Read) (NoCache)
(input viCompanyId, (CompanyId)
input 0, (PaySel_ID)
input icPaymentSelectionCode, (PaySelCode)
output dataset tqPaySelPrim) in BPaymentSelection>
find first tqPaySelPrim where tqPaySelPrim.tcPaySelCode = icPaymentSelectionCode no-error.
if not available tqPaySelPrim
then do:
assign
vcMessage = trim(#T-61'Invalid selection Code Entered':255(786893276)T-61#)
oiReturnStatus = -1.
<M-59 run SetMessage
(input vcMessage (icMessage),
input '' (icArguments),
input '' (icFieldName),
input icPaymentSelectionCode (icFieldValue),
input '':U (icType),
input 2 (iiSeverity),
input '' (icRowid),
input 'qadfin-899480':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output oiReturnStatus (oiReturnStatus)) in BPaymentSelection>
end. /* If not available tqPaySelPrim */
<M-43 run DataLoad
(input '':U (icRowids),
input tqPaySelPrim.tiPaySel_ID (icPkeys),
input '':U (icObjectIds),
input '' (icFreeform),
input no (ilKeepPrevious),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
if viFcReturnSuper <> 0
then do:
<M-88 run SetMessage
(input #T-21'The data could not be loaded. The system was unable to modify the payment selection.':100(2965)T-21# (icMessage),
input '':U (icArguments),
input '':U (icFieldName),
input '':U (icFieldValue),
input '':U (icType),
input 2 (iiSeverity),
input '':U (icRowid),
input 'qadfin-164005':U (icFcMsgNumber),
input '' (icFcExplanation),
input '' (icFcIdentification),
input '' (icFcContext),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
assign oiReturnStatus = -1.
return.
end.
find first tPaySel where tPaySel.PaySel_ID = tqPaySelPrim.tiPaySel_ID no-error.
/* Default the values */
<M-98 run DefaultValuesForApiConfirm
(input-output iiPostingYear (biPostingYear),
input-output iiPostingPeriod (biPostingPeriod),
input-output itPostingDate (btPostingDate),
input-output icPostingJournal (bcPostingJournal),
input-output itExecutionDate (btExecutionDate),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
assign
tPaySel.PaySelDate = itExecutionDate
tPaySel.tiPostingYear = iiPostingYear
tPaySel.tiPostingPeriod = iiPostingPeriod
tPaySel.ttPostingDate = itPostingDate
tPaySel.tcPostingJournal = icPostingJournal
tPaySel.tc_Status = "C":U.
<M-20 run ValidateBC (output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if (oiReturnStatus < 0) then return.
<M-87 run AdditionalUpdates (output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if (oiReturnStatus < 0) then return.
<M-48 run DataSave (output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.