Skip to content

Commit df66b0e

Browse files
author
Rohit Vobbilisetty
committed
Renamed BankAccount to DebitAccount
1 parent e4161e0 commit df66b0e

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/main/java/com/intuit/developer/tutorials/controller/AccountingController.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ public String callAccountingConcept(HttpSession session) {
6565
// Get DataService
6666
DataService service = helper.getDataService(realmId, accessToken);
6767

68-
// Create OR Fetch BankAccount
69-
Account savedAccount = getBankAccount(service);
68+
// Create OR Fetch DebitAccount
69+
Account savedDebitAccount = getDebitAccount(service);
7070

71-
// Create OR Fetch CreditCaerd Account
71+
// Create OR Fetch CreditCard Account
7272
Account savedCreditAccount = getCreditCardBankAccount(service);
7373

7474
// Create Journal Entry using the accounts above
7575

7676
try{
7777
// Add JournalEntry
78-
JournalEntry journalentry = getJournalEntryFields(service, savedAccount, savedCreditAccount);
78+
JournalEntry journalentry = getJournalEntryFields(service, savedDebitAccount, savedCreditAccount);
7979
JournalEntry savedJournalEntry = service.add(journalentry);
8080
logger.info("JournalEntry created: " + savedJournalEntry.getId());
8181

@@ -104,12 +104,12 @@ public String callAccountingConcept(HttpSession session) {
104104

105105

106106
/**
107-
* Initializes a BankAccount object
107+
* Initializes a DebitAccount object
108108
*
109-
* @return BankAccount object
109+
* @return DebitAccount object
110110
* @throws FMSException
111111
*/
112-
private static Account getBankAccountFields() throws FMSException {
112+
private static Account getDebitAccountFields() throws FMSException {
113113

114114
Account account = new Account();
115115
account.setName("Ba" + RandomStringUtils.randomAlphanumeric(7));
@@ -127,13 +127,13 @@ private static Account getBankAccountFields() throws FMSException {
127127
}
128128

129129
/**
130-
* Create OR lookup Bank Account
130+
* Create OR lookup Debit Account
131131
*
132132
* @param service Reference to the DataService to create the Account
133133
* @return The BankAccount object
134134
* @throws FMSException
135135
*/
136-
private static Account getBankAccount(DataService service) throws FMSException {
136+
private static Account getDebitAccount(DataService service) throws FMSException {
137137

138138
List<Account> accounts = (List<Account>) service.findAll(new Account());
139139

@@ -147,18 +147,18 @@ private static Account getBankAccount(DataService service) throws FMSException {
147147
}
148148
}
149149

150-
return createBankAccount(service);
150+
return createDebitAccount(service);
151151
}
152152

153153
/**
154-
* Creates the BankAccount by calling QBO V3 services
154+
* Creates the DebitAccount by calling QBO V3 services
155155
*
156156
* @param service Reference to the DataService to create the Account
157-
* @return The BankAccount object
157+
* @return The DebitAccount object
158158
* @throws FMSException
159159
*/
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());
162162
}
163163

164164
/**
@@ -227,13 +227,13 @@ private static Account getCreditCardBankAccountFields() throws FMSException {
227227
* This method internally creates or lookup a Vendor
228228
*
229229
* @param service Reference to the DataService to create the JournalEntry
230-
* @param bankAccount The BankAccount reference
230+
* @param debitAccount The BankAccount reference
231231
* @param creditAccount The CreditAccount reference
232232
* @return Reference to the created JournalEntry
233233
* @throws FMSException
234234
* @throws ParseException
235235
*/
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 {
237237

238238
JournalEntry journalEntry = new JournalEntry();
239239
try {
@@ -248,7 +248,7 @@ private static JournalEntry getJournalEntryFields(DataService service, Account b
248248
JournalEntryLineDetail journalEntryLineDetail1 = new JournalEntryLineDetail();
249249
journalEntryLineDetail1.setPostingType(PostingTypeEnum.DEBIT);
250250

251-
journalEntryLineDetail1.setAccountRef(getAccountRef(bankAccount));
251+
journalEntryLineDetail1.setAccountRef(getAccountRef(debitAccount));
252252

253253
line1.setJournalEntryLineDetail(journalEntryLineDetail1);
254254
line1.setDescription("Description " + RandomStringUtils.randomAlphanumeric(15));
@@ -263,7 +263,7 @@ private static JournalEntry getJournalEntryFields(DataService service, Account b
263263
journalEntryLineDetail2.setAccountRef(getAccountRef(creditAccount));
264264
EntityTypeRef eRef = new EntityTypeRef();
265265
eRef.setType(EntityTypeEnum.VENDOR);
266-
eRef.setEntityRef(getVendorRef(getVendor(service)));
266+
eRef.setEntityRef(getVendorRef(getVendor(service))); // Set a Vendor as reference
267267
journalEntryLineDetail2.setEntity(eRef);
268268

269269
line2.setJournalEntryLineDetail(journalEntryLineDetail2);

0 commit comments

Comments
 (0)