project QadFinancials > class BDInvoice > method TestApiUpdateCInvoiceWithNewBank
Description
Unit Test Method which tests calling the API 'ApiUpdateCInvoiceWithNewBank'
Parameters
Internal usage
unused
program code (program3/bdinvoice.p)
/* Clear temp table */
empty temp-table tApiUpdateDInvoiceWithNewBank.
/**********************************************************************/
/*
assign
vcPayFormatTypeCode = "CUST-CHECK"
vcOwnBankNumber = "55667342"
vcGlAccountCode = "1100".
create tApiUpdateDInvoiceWithNewBank.
assign
tApiUpdateDInvoiceWithNewBank.tiDInvoicePostingYear = 2012
tApiUpdateDInvoiceWithNewBank.tcDAJournalCode = "SALES"
tApiUpdateDInvoiceWithNewBank.tiDInvoiceVoucher = 24
tApiUpdateDInvoiceWithNewBank.tiCompany_ID = 219435.
assign vcListOfInoiceIDs = "".
*/
/**********************************************************************/
/* Closed invoice = 2566190 - Except an error
create tApiUpdateDInvoiceWithNewBank.
assign
tApiUpdateDInvoiceWithNewBank.tiDInvoicePostingYear = 2012
tApiUpdateDInvoiceWithNewBank.tcDAJournalCode = "CINV"
tApiUpdateDInvoiceWithNewBank.tiDInvoiceVoucher = 5
tApiUpdateDInvoiceWithNewBank.tiCompany_ID = 219435.
assign vcListOfInoiceIDs = "".
*/
/**********************************************************************/
/*
assign
vcPayFormatTypeCode = "CUST-CHECK"
vcOwnBankNumber = "AUS45960586"
vcGlAccountCode = "1140".
create tApiUpdateDInvoiceWithNewBank.
assign
tApiUpdateDInvoiceWithNewBank.tiDInvoicePostingYear = 2012
tApiUpdateDInvoiceWithNewBank.tcDAJournalCode = "SALES"
tApiUpdateDInvoiceWithNewBank.tiDInvoiceVoucher = 1
tApiUpdateDInvoiceWithNewBank.tiCompany_ID = 219579.
assign vcListOfInoiceIDs = "".
*/
/**********************************************************************/
/* sample list invoice id's to update
assign vcListOfInoiceIDs = "2673306,2659908,2650896,1".
assign
vcPayFormatTypeCode = "CUST-CHECK"
vcOwnBankNumber = "55667342"
vcGlAccountCode = "1100".
*/
/**********************************************************************/
/* Call with a list of invoice id's
assign vcListOfInoiceIDs = "2673358,2659908".*/
/* Supply a bank number id
assign
viBankNumber_ID = 2583720.*/
/*********************************************************************
assign
vcPayFormatTypeCode = "CUST-CHECK"
vcOwnBankNumber = "55667342"
vcGlAccountCode = "1100".
create tApiUpdateDInvoiceWithNewBank.
assign
tApiUpdateDInvoiceWithNewBank.tiDInvoicePostingYear = 2012
tApiUpdateDInvoiceWithNewBank.tcDAJournalCode = "SALES"
tApiUpdateDInvoiceWithNewBank.tiDInvoiceVoucher = 24
tApiUpdateDInvoiceWithNewBank.tiCompany_ID = 219435.
*********************************************************************/
/*
assign
vcPayFormatTypeCode = "FR-LCR-AR"
vcOwnBankNumber = "112667890x"
vcGlAccountCode = "1110".
assign
vcPayFormatTypeCode = "USChase"
vcOwnBankNumber = "M4865O3"
vcGlAccountCode = "M4865-A3".
assign
vcPayFormatTypeCode = "Default AR PayFormat"
vcOwnBankNumber = "M4865O2"
vcGlAccountCode = "M4865-A2".
*/
/*
assign
vcPayFormatTypeCode = "BR-REMCOBCITI-AR"
vcOwnBankNumber = "Citybank"
vcGlAccountCode = "1170".
*/
/* 2012/sales/000000026 */
/* SP 10 TEST DATA
assign
vcPayFormatTypeCode = "Default AR PayFormat"
vcOwnBankNumber = "any"
vcGlAccountCode = "1040"
viBankNumber_ID = 13948297.
assign
vcPayFormatTypeCode = "Default AR PayFormat"
vcOwnBankNumber = "7658"
vcGlAccountCode = "1049"
viBankNumber_ID = 13948298.
assign
vcPayFormatTypeCode = "Default AR PayFormat"
vcOwnBankNumber = "234234"
vcGlAccountCode = "1046"
viBankNumber_ID = 13948299.
create tApiUpdateDInvoiceWithNewBank.
assign
tApiUpdateDInvoiceWithNewBank.tiDInvoicePostingYear = 2013
tApiUpdateDInvoiceWithNewBank.tcDAJournalCode = "ARINV"
tApiUpdateDInvoiceWithNewBank.tiDInvoiceVoucher = 16
tApiUpdateDInvoiceWithNewBank.tiCompany_ID = 9144.
*/
/* Populate the data table */
do viCounter = num-entries(vcListOfInoiceIDs,",":U) to 1 by -1 :
create tApiUpdateDInvoiceWithNewBank.
assign tApiUpdateDInvoiceWithNewBank.tiDInvoice_ID = INTEGER(entry(viCounter,vcListOfInoiceIDs,",":U)).
end. /* do */
<M-12 run ApiUpdateCInvoiceWithNewBank
(input-output tApiUpdateDInvoiceWithNewBank (tApiUpdateDInvoiceWithNewBank),
input viBankNumber_ID (iiBankNumber_ID),
input vcOwnBankNumber (icOwnBankNumber),
input vcPayFormatTypeCode (icPayFormatTypeCode),
input vcGlAccountCode (icGlAccountCode),
output viFcReturnSuper (oiReturnStatus)) in BDInvoice>