@@ -65,17 +65,17 @@ public String callAccountingConcept(HttpSession session) {
65
65
// Get DataService
66
66
DataService service = helper .getDataService (realmId , accessToken );
67
67
68
- // Create OR Fetch BankAccount
69
- Account savedAccount = getBankAccount (service );
68
+ // Create OR Fetch DebitAccount
69
+ Account savedDebitAccount = getDebitAccount (service );
70
70
71
- // Create OR Fetch CreditCaerd Account
71
+ // Create OR Fetch CreditCard Account
72
72
Account savedCreditAccount = getCreditCardBankAccount (service );
73
73
74
74
// Create Journal Entry using the accounts above
75
75
76
76
try {
77
77
// Add JournalEntry
78
- JournalEntry journalentry = getJournalEntryFields (service , savedAccount , savedCreditAccount );
78
+ JournalEntry journalentry = getJournalEntryFields (service , savedDebitAccount , savedCreditAccount );
79
79
JournalEntry savedJournalEntry = service .add (journalentry );
80
80
logger .info ("JournalEntry created: " + savedJournalEntry .getId ());
81
81
@@ -104,12 +104,12 @@ public String callAccountingConcept(HttpSession session) {
104
104
105
105
106
106
/**
107
- * Initializes a BankAccount object
107
+ * Initializes a DebitAccount object
108
108
*
109
- * @return BankAccount object
109
+ * @return DebitAccount object
110
110
* @throws FMSException
111
111
*/
112
- private static Account getBankAccountFields () throws FMSException {
112
+ private static Account getDebitAccountFields () throws FMSException {
113
113
114
114
Account account = new Account ();
115
115
account .setName ("Ba" + RandomStringUtils .randomAlphanumeric (7 ));
@@ -127,13 +127,13 @@ private static Account getBankAccountFields() throws FMSException {
127
127
}
128
128
129
129
/**
130
- * Create OR lookup Bank Account
130
+ * Create OR lookup Debit Account
131
131
*
132
132
* @param service Reference to the DataService to create the Account
133
133
* @return The BankAccount object
134
134
* @throws FMSException
135
135
*/
136
- private static Account getBankAccount (DataService service ) throws FMSException {
136
+ private static Account getDebitAccount (DataService service ) throws FMSException {
137
137
138
138
List <Account > accounts = (List <Account >) service .findAll (new Account ());
139
139
@@ -147,18 +147,18 @@ private static Account getBankAccount(DataService service) throws FMSException {
147
147
}
148
148
}
149
149
150
- return createBankAccount (service );
150
+ return createDebitAccount (service );
151
151
}
152
152
153
153
/**
154
- * Creates the BankAccount by calling QBO V3 services
154
+ * Creates the DebitAccount by calling QBO V3 services
155
155
*
156
156
* @param service Reference to the DataService to create the Account
157
- * @return The BankAccount object
157
+ * @return The DebitAccount object
158
158
* @throws FMSException
159
159
*/
160
- private static Account createBankAccount (DataService service ) throws FMSException {
161
- return service .add (getBankAccountFields ());
160
+ private static Account createDebitAccount (DataService service ) throws FMSException {
161
+ return service .add (getDebitAccountFields ());
162
162
}
163
163
164
164
/**
@@ -227,13 +227,13 @@ private static Account getCreditCardBankAccountFields() throws FMSException {
227
227
* This method internally creates or lookup a Vendor
228
228
*
229
229
* @param service Reference to the DataService to create the JournalEntry
230
- * @param bankAccount The BankAccount reference
230
+ * @param debitAccount The BankAccount reference
231
231
* @param creditAccount The CreditAccount reference
232
232
* @return Reference to the created JournalEntry
233
233
* @throws FMSException
234
234
* @throws ParseException
235
235
*/
236
- private static JournalEntry getJournalEntryFields (DataService service , Account bankAccount , Account creditAccount ) throws FMSException , ParseException {
236
+ private static JournalEntry getJournalEntryFields (DataService service , Account debitAccount , Account creditAccount ) throws FMSException , ParseException {
237
237
238
238
JournalEntry journalEntry = new JournalEntry ();
239
239
try {
@@ -248,7 +248,7 @@ private static JournalEntry getJournalEntryFields(DataService service, Account b
248
248
JournalEntryLineDetail journalEntryLineDetail1 = new JournalEntryLineDetail ();
249
249
journalEntryLineDetail1 .setPostingType (PostingTypeEnum .DEBIT );
250
250
251
- journalEntryLineDetail1 .setAccountRef (getAccountRef (bankAccount ));
251
+ journalEntryLineDetail1 .setAccountRef (getAccountRef (debitAccount ));
252
252
253
253
line1 .setJournalEntryLineDetail (journalEntryLineDetail1 );
254
254
line1 .setDescription ("Description " + RandomStringUtils .randomAlphanumeric (15 ));
@@ -263,7 +263,7 @@ private static JournalEntry getJournalEntryFields(DataService service, Account b
263
263
journalEntryLineDetail2 .setAccountRef (getAccountRef (creditAccount ));
264
264
EntityTypeRef eRef = new EntityTypeRef ();
265
265
eRef .setType (EntityTypeEnum .VENDOR );
266
- eRef .setEntityRef (getVendorRef (getVendor (service )));
266
+ eRef .setEntityRef (getVendorRef (getVendor (service ))); // Set a Vendor as reference
267
267
journalEntryLineDetail2 .setEntity (eRef );
268
268
269
269
line2 .setJournalEntryLineDetail (journalEntryLineDetail2 );
0 commit comments