Skip to content

Commit

Permalink
fix LineItem case for invoices & receipts
Browse files Browse the repository at this point in the history
  • Loading branch information
SidneyAllen committed Aug 8, 2019
1 parent 1130742 commit b8266e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.github.xeroapi</groupId>
<artifactId>xero-java</artifactId>
<packaging>jar</packaging>
<version>2.3.11</version>
<version>2.3.12</version>
<name>Xero-Java SDK</name>
<description>This is the official Java SDK for Xero API</description>
<url>https://github.com/XeroAPI/Xero-Java</url>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/xero/api/JsonConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

public class JsonConfig implements Config {

private String SDK_VERSION = "2.3.11";
private String SDK_VERSION = "2.3.12";
private String APP_TYPE = "Public";
private String USER_AGENT = "Xero-Java-SDK";
private String ACCEPT = "application/xml";
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/xero/example/RequestResourceServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
} else if (object.equals("BankTransactions")) {
/* BANK TRANSACTION */
try {

where = "Status==\"ACTIVE\"&&Type==\"BANK\"";
Accounts accountsWhere = accountingApi.getAccounts(ifModifiedSince, where, order);

Expand All @@ -1117,7 +1118,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
BankTransaction bt = new BankTransaction();
bt.setBankAccount(bankAcct);
bt.setContact(useContact);
bt.setLineitems(lineItems);
bt.setLineItems(lineItems);
bt.setType(com.xero.models.accounting.BankTransaction.TypeEnum.SPEND);
BankTransactions bts = new BankTransactions();
bts.addBankTransactionsItem(bt);
Expand Down Expand Up @@ -1159,7 +1160,6 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
messages.add("Create a one Bank Transaction History Record - details :" + newHr.getHistoryRecords().get(0).getDetails());
*/
}

} catch (Exception e) {
System.out.println(e.getMessage());
}
Expand Down Expand Up @@ -1361,7 +1361,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)

HistoryRecords newInvoiceHistory = accountingApi.createContactHistory(contactID,newHistoryRecords);
messages.add("Contact History - note added to : " + newInvoiceHistory.getHistoryRecords().get(0).getDetails());

} catch (XeroApiException e) {
System.out.println(e.getResponseCode());
System.out.println(e.getMessage());
Expand Down Expand Up @@ -1623,7 +1623,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
li.setLineAmount(40.00);
li.setTaxType("NONE");

receipt.addLineitemsItem(li);
receipt.addLineItemsItem(li);
receipt.setUser(user);
receipt.lineAmountTypes(LineAmountTypes.NOTAX);
receipt.contact(useContact);
Expand Down Expand Up @@ -2098,7 +2098,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
BankTransaction bt = new BankTransaction();
bt.setBankAccount(bankAccount);
bt.setContact(useContact);
bt.setLineitems(lineItems);
bt.setLineItems(lineItems);
bt.setType(com.xero.models.accounting.BankTransaction.TypeEnum.RECEIVE_OVERPAYMENT);
BankTransactions bts = new BankTransactions();
bts.addBankTransactionsItem(bt);
Expand Down Expand Up @@ -2247,7 +2247,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
BankTransaction bt = new BankTransaction();
bt.setBankAccount(bankAccount);
bt.setContact(useContact);
bt.setLineitems(lineItems);
bt.setLineItems(lineItems);
bt.setType(com.xero.models.accounting.BankTransaction.TypeEnum.RECEIVE_PREPAYMENT);
BankTransactions bts = new BankTransactions();
bts.addBankTransactionsItem(bt);
Expand Down Expand Up @@ -2392,7 +2392,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
li.setLineAmount(40.00);
li.setTaxType("NONE");

receipt.addLineitemsItem(li);
receipt.addLineItemsItem(li);
receipt.setUser(useUser);
receipt.lineAmountTypes(LineAmountTypes.NOTAX);
receipt.contact(useContact);
Expand Down

0 comments on commit b8266e9

Please sign in to comment.