Description
CreateHistoryRecord
Parameters
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program5/bpaymentselection.p)
/* Create a history record for new Payment Selections */
for each tPaySel where
tPaySel.tc_Status = "N":U:
<M-98 run AddDetailLine
(input 'PaySelHistory':U (icTable),
input tPaySel.tc_Rowid (icParentRowid),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then return.
assign tPaySelHistory.PaySelHistoryDate = today
tPaySelHistory.PaySelHistoryDescription = substring(trim(#T-81'Created':40(733717986)T-81#),1,40,'CHARACTER':U)
tPaySelHistory.PaySelStatus = {&PAYMENTSELECTIONSTATUS-INITIAL}.
end.
/* Create a history record for registered Payment Selections */
if vcActivityCode = {&PAYMENTSELECTIONACTIVITY-REGISTER}
then for each tPaySel where
tPaySel.tc_Status = "C":U:
if viLastInvGroupNbr = 1 then
do:
<M-48 run AddDetailLine
(input 'PaySelHistory':U (icTable),
input tPaySel.tc_Rowid (icParentRowid),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then return.
<M-4 run GetPaymentInstrument
(input tPaySel.BankPayFormat_ID (iiBankPayFormatID),
output vcPayInst (ocPaymentInstrument),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
assign tPaySelHistory.PaySelHistoryDate = today
tPaySelHistory.PaySelHistoryDescription = substring(trim(#T-64'Confirmed':40(4770)T-64#),1,40,'CHARACTER':U)
tPaySelHistory.PaySelStatus = if vcPayInst = {&DOCUMENTTYPECREDITOR-ELECTRONIC}
then {&PAYMENTSELECTIONSTATUS-REGISTERED}
else {&PAYMENTSELECTIONSTATUS-TRANSFERRED}.
end.
end.
if vcActivityCode = {&PAYMENTSELECTIONACTIVITY-UNCONFIRM}
then for each tPaySel where
tPaySel.tc_Status = "C":U:
if viLastInvGroupNbr = 1 then
do:
<M-37 run AddDetailLine
(input 'PaySelHistory':U (icTable),
input tPaySel.tc_Rowid (icParentRowid),
output viFcReturnSuper (oiReturnStatus)) in BPaymentSelection>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then return.
assign tPaySelHistory.PaySelHistoryDate = today
tPaySelHistory.PaySelHistoryDescription = substring(trim(#T-16'Unconfirmed':40(73438224)T-16#),1,40,'CHARACTER':U)
tPaySelHistory.PaySelStatus = {&PAYMENTSELECTIONSTATUS-INITIAL}.
end.
end.