project QadFinancials > class BCInvoice > method DefaultValuesBankCreateCIBankPayCode
Parameters
iiCInvoiceBankId | input | integer | |
iiBankNumberId | input | integer | |
icCInvoiceBankRowid | input | character | |
tApiCInvoiceBankPayCode | output | temp-table | |
oiReturnStatus | output | integer | Return status of the method. |
Internal usage
QadFinancials
program code (program3/bcinvoice.p)
empty temp-table tApiCInvoiceBankPayCode.
if iiCInvoiceBankId = ? or
iiCInvoiceBankId = 0 or
iiBankNumberId = ? or
iiBankNumberId = 0
then return.
/* Delete all t_oCInvoiceBankPayCode associated with the specified CInvoiceBank so when the user */
/* changes the bank on the CInvoiceBank, the old CInvoiceBankPayCode gets deleted */
for each tCInvoiceBankPayCode where
tCInvoiceBankPayCode.tc_ParentRowid = icCInvoiceBankRowid:
if tCInvoiceBankPayCode.tc_Status = "N":U
then delete tCInvoiceBankPayCode.
else assign tCInvoiceBankPayCode.tc_Status = "D":U.
end.
<Q-3 run BankNumberPayCodeForCIDefSupp (all) (Read) (NoCache)
(input iiBankNumberId, (BankNumberId)
output dataset tqBankNumberPayCodeForCIDefSupp) in BBankNumber>
for each tqBankNumberPayCodeForCIDefSupp where
tqBankNumberPayCodeForCIDefSupp.tiBankNumber_ID = iiBankNumberId:
<M-2 run AddDetailLine
(input 'CInvoiceBankPayCode':U (icTable),
input icCInvoiceBankRowid (icParentRowid),
output viFcReturnSuper (oiReturnStatus)) in BCInvoice>
if viFcReturnSuper < 0 or
oiReturnStatus = 0
then assign oiReturnStatus = viFcReturnSuper.
if oiReturnStatus < 0
then return.
assign tCInvoiceBankPayCode.CInvoiceBank_ID = iiCInvoiceBankId
tCInvoiceBankPayCode.PayFormatGroup_ID = tqBankNumberPayCodeForCIDefSupp.tiPayFormatGroup_ID
tCInvoiceBankPayCode.PayFormatCode_ID = tqBankNumberPayCodeForCIDefSupp.tiPayFormatCode_ID
tCInvoiceBankPayCode.CInvoiceBankPayCodeValue = (if tqBankNumberPayCodeForCIDefSupp.tcBankNumberPayCodeValue <> ? and
tqBankNumberPayCodeForCIDefSupp.tcBankNumberPayCodeValue <> "":U
then tqBankNumberPayCodeForCIDefSupp.tcBankNumberPayCodeValue
else tqBankNumberPayCodeForCIDefSupp.tcPayFormatCode)
tCInvoiceBankPayCode.tcPayFormatGroupCode = tqBankNumberPayCodeForCIDefSupp.tcPayFormatGroupCode
tCInvoiceBankPayCode.tcPayFormatGroupDescription = tqBankNumberPayCodeForCIDefSupp.tcPayFormatGroupDescription
tCInvoiceBankPayCode.tlPayFormatGroupIsMandatory = tqBankNumberPayCodeForCIDefSupp.tlPayFormatGroupIsMandatory
tCInvoiceBankPayCode.tcPayFormatGroupInputOption = tqBankNumberPayCodeForCIDefSupp.tcPayFormatGroupInputOption
tCInvoiceBankPayCode.tcPayFormatGroupDataType = tqBankNumberPayCodeForCIDefSupp.tcPayFormatGroupDataType.
if tCInvoiceBankPayCode.tcPayFormatGroupDataType = {&PAYFORMATGROUPDATATYPE-LOGICAL} and
(tCInvoiceBankPayCode.CInvoiceBankPayCodeValue = ? or
tCInvoiceBankPayCode.CInvoiceBankPayCodeValue = "":U)
then assign tCInvoiceBankPayCode.CInvoiceBankPayCodeValue = "false":U.
create tApiCInvoiceBankPayCode.
buffer-copy tCInvoiceBankPayCode to tApiCInvoiceBankPayCode.
end.