Skip to content

Commit

Permalink
Bump to version 0.6.7
Browse files Browse the repository at this point in the history
small fix to models moved to 0.1.2
  • Loading branch information
SidneyAllen committed Feb 27, 2018
1 parent 86f7c2c commit e41b389
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Add this dependency and repository to your POM.xml
<dependency>
<groupId>com.xero</groupId>
<artifactId>xero-java-sdk</artifactId>
<version>0.6.6</version>
<version>0.6.7</version>
</dependency>

<repositories>
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.xero</groupId>
<artifactId>xero-java-sdk</artifactId>
<packaging>jar</packaging>
<version>0.6.6</version>
<version>0.6.7</version>
<name>Xero-Java SDK</name>
<url>http://maven.apache.org</url>
<dependencies>
Expand All @@ -26,7 +26,7 @@
<dependency>
<groupId>com.xero</groupId>
<artifactId>xero-accounting-api-schema</artifactId>
<version>0.1.1</version>
<version>0.1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
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 @@ -106,7 +106,7 @@ public String getAccessTokenUrl() {

@Override
public String getUserAgent() {
return USER_AGENT + " [Xero-Java-0.6.6]";
return USER_AGENT + " [Xero-Java-0.6.7]";
}

@Override
Expand Down
32 changes: 32 additions & 0 deletions src/main/java/com/xero/example/SampleData.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,18 +270,50 @@ public static ArrayOfManualJournal loadManualJournal() throws IOException {
if (accountDirectCosts.size() == 0 ){
System.out.println("no direct cost accounts");
}

// GET ALL YOUR TRACKING CATEGORIES
List<TrackingCategory> TrackingCategoryList = client.getTrackingCategories();

// Create a New Array to Populate with a chosen Tracking Category
ArrayOfTrackingCategory arrayTracking = new ArrayOfTrackingCategory();

if (TrackingCategoryList.size() > 0) {
// Get the options for a Tracking Category 1
ArrayOfTrackingCategoryOption options1 = TrackingCategoryList.get(0).getOptions();
List<TrackingCategoryOption> optionList1 = options1.getOption();

// Populate the option 1 with the Name of the Cateogry and Option
TrackingCategory category1 = new TrackingCategory();
category1.setName(TrackingCategoryList.get(0).getName());
category1.setOption(optionList1.get(0).getName());

arrayTracking.getTrackingCategory().add(category1);

// Get the options for a Tracking Category 2
ArrayOfTrackingCategoryOption options2 = TrackingCategoryList.get(1).getOptions();
List<TrackingCategoryOption> optionList2 = options2.getOption();

// Populate the option 2 with the Name of the Cateogry and Option
TrackingCategory category2 = new TrackingCategory();
category2.setName(TrackingCategoryList.get(1).getName());
category2.setOption(optionList2.get(1).getName());

arrayTracking.getTrackingCategory().add(category2);

}

ManualJournalLine debit = new ManualJournalLine();
debit.setDescription("My MJ Debit");
debit.setAccountCode("400");
debit.setLineAmount(new BigDecimal(10.00));
debit.setTracking(arrayTracking);
arrayOfMJLine.getJournalLine().add(debit);

ManualJournalLine credit = new ManualJournalLine();
credit.setDescription("My MJ Credit");
credit.setAccountCode("500");
credit.setLineAmount(new BigDecimal(-10.00));
credit.setTracking(arrayTracking);
arrayOfMJLine.getJournalLine().add(credit);

ManualJournal mj = new ManualJournal();
Expand Down

0 comments on commit e41b389

Please sign in to comment.