Skip to content

Commit d0c0d9b

Browse files
committed
Updates for Unit Decimal points
To address the use case where a queryString includes the unitdp=4 param we need to change objects with attributes that support more than two decimal points to to change the number datatype from double to float. Added missing unitdp to methods ... Added to the following .. BankTransactions - getBankTransaction - createBankTransactions - updateBankTransaction - updateOrCreate CreditNotes - getCreditNotes - createCreditNotes - updateCreditNote - updateOrCreateCreditNotes Invoices - getInvoice - createInvoices - updateInvoice - updateOrCreateInvoices Items - getItem - createItems - updateItem - updateOrCreateItems Receipts - getReceipts - getReceipt - createReceipt - updateReceipt Objects that use LineItems are impacted - BankTransations - CreditNotes - Invoices - Receipts the two properties that changed from double to float - Quantity - UnitAmount The Purchase object property changed from double to float - UnitPrice The Item object has the property changed from double to float - QuantityOnHand Added ARCHIVED Status to Manual Journal object Added SalesTaxPeriod NONE to organisation object Added Reference attribute to Prepayment object Added VOIDED status to Receipt object Added DELETED status to RepeatingInvoice object Updated corresponding Unit Tests
1 parent e964aa0 commit d0c0d9b

23 files changed

Lines changed: 406 additions & 150 deletions

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>xero-java</artifactId>
66
<packaging>jar</packaging>
77
<name>xero-java</name>
8-
<version>3.2.3</version>
8+
<version>3.3.0</version>
99
<url>https://github.com/XeroAPI/Xero-Java</url>
1010
<description>This is the official Java SDK for Xero API</description>
1111
<licenses>

src/main/java/com/xero/api/client/AccountingApi.java

Lines changed: 292 additions & 61 deletions
Large diffs are not rendered by default.

src/main/java/com/xero/api/client/AssetApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public class AssetApi {
4444
private ApiClient apiClient;
4545
private static AssetApi instance = null;
4646
private String userAgent = "Default";
47-
private String version = "3.2.3";
47+
private String version = "3.3.0";
4848

4949
public AssetApi() {
5050
this(new ApiClient());

src/main/java/com/xero/api/client/BankFeedsApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class BankFeedsApi {
4545
private ApiClient apiClient;
4646
private static BankFeedsApi instance = null;
4747
private String userAgent = "Default";
48-
private String version = "3.2.3";
48+
private String version = "3.3.0";
4949

5050
public BankFeedsApi() {
5151
this(new ApiClient());

src/main/java/com/xero/api/client/IdentityApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class IdentityApi {
4141
private ApiClient apiClient;
4242
private static IdentityApi instance = null;
4343
private String userAgent = "Default";
44-
private String version = "3.2.3";
44+
private String version = "3.3.0";
4545

4646
public IdentityApi() {
4747
this(new ApiClient());

src/main/java/com/xero/models/accounting/Item.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public class Item {
8282

8383

8484
@JsonProperty("QuantityOnHand")
85-
private Double quantityOnHand;
85+
private Float quantityOnHand;
8686

8787
@JsonDeserialize(using = com.xero.api.CustomOffsetDateTimeDeserializer.class)
8888
@JsonProperty("UpdatedDateUTC")
@@ -297,7 +297,7 @@ public void setTotalCostPool(Double totalCostPool) {
297297
this.totalCostPool = totalCostPool;
298298
}
299299

300-
public Item quantityOnHand(Double quantityOnHand) {
300+
public Item quantityOnHand(Float quantityOnHand) {
301301
this.quantityOnHand = quantityOnHand;
302302
return this;
303303
}
@@ -307,11 +307,11 @@ public Item quantityOnHand(Double quantityOnHand) {
307307
* @return quantityOnHand
308308
**/
309309
@ApiModelProperty(value = "The quantity of the item on hand")
310-
public Double getQuantityOnHand() {
310+
public Float getQuantityOnHand() {
311311
return quantityOnHand;
312312
}
313313

314-
public void setQuantityOnHand(Double quantityOnHand) {
314+
public void setQuantityOnHand(Float quantityOnHand) {
315315
this.quantityOnHand = quantityOnHand;
316316
}
317317

src/main/java/com/xero/models/accounting/LineItem.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ public class LineItem {
4444

4545

4646
@JsonProperty("Quantity")
47-
private Double quantity;
47+
private Float quantity;
4848

4949

5050
@JsonProperty("UnitAmount")
51-
private Double unitAmount;
51+
private Float unitAmount;
5252

5353

5454
@JsonProperty("ItemCode")
@@ -121,7 +121,7 @@ public void setDescription(String description) {
121121
this.description = description;
122122
}
123123

124-
public LineItem quantity(Double quantity) {
124+
public LineItem quantity(Float quantity) {
125125
this.quantity = quantity;
126126
return this;
127127
}
@@ -131,15 +131,15 @@ public LineItem quantity(Double quantity) {
131131
* @return quantity
132132
**/
133133
@ApiModelProperty(value = "LineItem Quantity")
134-
public Double getQuantity() {
134+
public Float getQuantity() {
135135
return quantity;
136136
}
137137

138-
public void setQuantity(Double quantity) {
138+
public void setQuantity(Float quantity) {
139139
this.quantity = quantity;
140140
}
141141

142-
public LineItem unitAmount(Double unitAmount) {
142+
public LineItem unitAmount(Float unitAmount) {
143143
this.unitAmount = unitAmount;
144144
return this;
145145
}
@@ -149,11 +149,11 @@ public LineItem unitAmount(Double unitAmount) {
149149
* @return unitAmount
150150
**/
151151
@ApiModelProperty(value = "LineItem Unit Amount")
152-
public Double getUnitAmount() {
152+
public Float getUnitAmount() {
153153
return unitAmount;
154154
}
155155

156-
public void setUnitAmount(Double unitAmount) {
156+
public void setUnitAmount(Float unitAmount) {
157157
this.unitAmount = unitAmount;
158158
}
159159

src/main/java/com/xero/models/accounting/ManualJournal.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ public enum StatusEnum {
6464

6565
DELETED("DELETED"),
6666

67-
VOIDED("VOIDED");
67+
VOIDED("VOIDED"),
68+
69+
ARCHIVED("ARCHIVED");
6870

6971
private String value;
7072

src/main/java/com/xero/models/accounting/Organisation.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ public enum SalesTaxPeriodEnum {
288288

289289
QUARTERLY("QUARTERLY"),
290290

291-
YEARLY("YEARLY");
291+
YEARLY("YEARLY"),
292+
293+
NONE("NONE");
292294

293295
private String value;
294296

src/main/java/com/xero/models/accounting/Prepayment.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ public static StatusEnum fromValue(String value) {
153153
@JsonProperty("Total")
154154
private Double total;
155155

156+
157+
@JsonProperty("Reference")
158+
private String reference;
159+
156160
@JsonDeserialize(using = com.xero.api.CustomOffsetDateTimeDeserializer.class)
157161
@JsonProperty("UpdatedDateUTC")
158162
private OffsetDateTime updatedDateUTC;
@@ -354,6 +358,15 @@ public void setTotal(Double total) {
354358
this.total = total;
355359
}
356360

361+
/**
362+
* Returns Invoice number field. Reference field isn&#39;t available.
363+
* @return reference
364+
**/
365+
@ApiModelProperty(value = "Returns Invoice number field. Reference field isn't available.")
366+
public String getReference() {
367+
return reference;
368+
}
369+
357370
public Prepayment updatedDateUTC(OffsetDateTime updatedDateUTC) {
358371
this.updatedDateUTC = updatedDateUTC;
359372
return this;
@@ -533,6 +546,7 @@ public boolean equals(java.lang.Object o) {
533546
Objects.equals(this.subTotal, prepayment.subTotal) &&
534547
Objects.equals(this.totalTax, prepayment.totalTax) &&
535548
Objects.equals(this.total, prepayment.total) &&
549+
Objects.equals(this.reference, prepayment.reference) &&
536550
Objects.equals(this.updatedDateUTC, prepayment.updatedDateUTC) &&
537551
Objects.equals(this.currencyCode, prepayment.currencyCode) &&
538552
Objects.equals(this.prepaymentID, prepayment.prepaymentID) &&
@@ -545,7 +559,7 @@ public boolean equals(java.lang.Object o) {
545559

546560
@Override
547561
public int hashCode() {
548-
return Objects.hash(type, contact, date, status, lineAmountTypes, lineItems, subTotal, totalTax, total, updatedDateUTC, currencyCode, prepaymentID, currencyRate, remainingCredit, allocations, hasAttachments, attachments);
562+
return Objects.hash(type, contact, date, status, lineAmountTypes, lineItems, subTotal, totalTax, total, reference, updatedDateUTC, currencyCode, prepaymentID, currencyRate, remainingCredit, allocations, hasAttachments, attachments);
549563
}
550564

551565

@@ -562,6 +576,7 @@ public String toString() {
562576
sb.append(" subTotal: ").append(toIndentedString(subTotal)).append("\n");
563577
sb.append(" totalTax: ").append(toIndentedString(totalTax)).append("\n");
564578
sb.append(" total: ").append(toIndentedString(total)).append("\n");
579+
sb.append(" reference: ").append(toIndentedString(reference)).append("\n");
565580
sb.append(" updatedDateUTC: ").append(toIndentedString(updatedDateUTC)).append("\n");
566581
sb.append(" currencyCode: ").append(toIndentedString(currencyCode)).append("\n");
567582
sb.append(" prepaymentID: ").append(toIndentedString(prepaymentID)).append("\n");

0 commit comments

Comments
 (0)