Skip to content

Commit e41b389

Browse files
committed
Bump to version 0.6.7
small fix to models moved to 0.1.2
1 parent 86f7c2c commit e41b389

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Add this dependency and repository to your POM.xml
1616
<dependency>
1717
<groupId>com.xero</groupId>
1818
<artifactId>xero-java-sdk</artifactId>
19-
<version>0.6.6</version>
19+
<version>0.6.7</version>
2020
</dependency>
2121

2222
<repositories>

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.xero</groupId>
55
<artifactId>xero-java-sdk</artifactId>
66
<packaging>jar</packaging>
7-
<version>0.6.6</version>
7+
<version>0.6.7</version>
88
<name>Xero-Java SDK</name>
99
<url>http://maven.apache.org</url>
1010
<dependencies>
@@ -26,7 +26,7 @@
2626
<dependency>
2727
<groupId>com.xero</groupId>
2828
<artifactId>xero-accounting-api-schema</artifactId>
29-
<version>0.1.1</version>
29+
<version>0.1.2</version>
3030
</dependency>
3131
<dependency>
3232
<groupId>javax.servlet</groupId>

src/main/java/com/xero/api/JsonConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public String getAccessTokenUrl() {
106106

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

112112
@Override

src/main/java/com/xero/example/SampleData.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,18 +270,50 @@ public static ArrayOfManualJournal loadManualJournal() throws IOException {
270270
if (accountDirectCosts.size() == 0 ){
271271
System.out.println("no direct cost accounts");
272272
}
273+
274+
// GET ALL YOUR TRACKING CATEGORIES
275+
List<TrackingCategory> TrackingCategoryList = client.getTrackingCategories();
276+
277+
// Create a New Array to Populate with a chosen Tracking Category
278+
ArrayOfTrackingCategory arrayTracking = new ArrayOfTrackingCategory();
279+
280+
if (TrackingCategoryList.size() > 0) {
281+
// Get the options for a Tracking Category 1
282+
ArrayOfTrackingCategoryOption options1 = TrackingCategoryList.get(0).getOptions();
283+
List<TrackingCategoryOption> optionList1 = options1.getOption();
273284

285+
// Populate the option 1 with the Name of the Cateogry and Option
286+
TrackingCategory category1 = new TrackingCategory();
287+
category1.setName(TrackingCategoryList.get(0).getName());
288+
category1.setOption(optionList1.get(0).getName());
289+
290+
arrayTracking.getTrackingCategory().add(category1);
291+
292+
// Get the options for a Tracking Category 2
293+
ArrayOfTrackingCategoryOption options2 = TrackingCategoryList.get(1).getOptions();
294+
List<TrackingCategoryOption> optionList2 = options2.getOption();
295+
296+
// Populate the option 2 with the Name of the Cateogry and Option
297+
TrackingCategory category2 = new TrackingCategory();
298+
category2.setName(TrackingCategoryList.get(1).getName());
299+
category2.setOption(optionList2.get(1).getName());
300+
301+
arrayTracking.getTrackingCategory().add(category2);
302+
303+
}
274304

275305
ManualJournalLine debit = new ManualJournalLine();
276306
debit.setDescription("My MJ Debit");
277307
debit.setAccountCode("400");
278308
debit.setLineAmount(new BigDecimal(10.00));
309+
debit.setTracking(arrayTracking);
279310
arrayOfMJLine.getJournalLine().add(debit);
280311

281312
ManualJournalLine credit = new ManualJournalLine();
282313
credit.setDescription("My MJ Credit");
283314
credit.setAccountCode("500");
284315
credit.setLineAmount(new BigDecimal(-10.00));
316+
credit.setTracking(arrayTracking);
285317
arrayOfMJLine.getJournalLine().add(credit);
286318

287319
ManualJournal mj = new ManualJournal();

0 commit comments

Comments
 (0)