Skip to content

Commit 5c52f1f

Browse files
author
sangeet-joy_xero
committed
[UST-4371] Add USST fields to Invoices and Credit Notes endpoints
1 parent c4cb047 commit 5c52f1f

File tree

12 files changed

+1002
-15
lines changed

12 files changed

+1002
-15
lines changed

docs/accounting/CreditNote.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Name | Type | Description | Notes
3434
**has_errors** | **Boolean** | A boolean to indicate if a credit note has an validation errors | [optional] [default to false]
3535
**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional]
3636
**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional]
37+
**invoice_addresses** | [**Array<InvoiceAddress>**](InvoiceAddress.md) | An array of addresses used to auto calculate sales tax | [optional]
3738

3839
## Code Sample
3940

@@ -69,7 +70,8 @@ instance = XeroRuby::Accounting::CreditNote.new(type: null,
6970
has_attachments: false,
7071
has_errors: false,
7172
validation_errors: null,
72-
warnings: null)
73+
warnings: null,
74+
invoice_addresses: null)
7375
```
7476

7577

docs/accounting/Invoice.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Name | Type | Description | Notes
4444
**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional]
4545
**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional]
4646
**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional]
47+
**invoice_addresses** | [**Array<InvoiceAddress>**](InvoiceAddress.md) | An array of addresses used to auto calculate sales tax | [optional]
4748

4849
## Code Sample
4950

@@ -89,7 +90,8 @@ instance = XeroRuby::Accounting::Invoice.new(type: null,
8990
has_errors: false,
9091
status_attribute_string: null,
9192
validation_errors: null,
92-
warnings: null)
93+
warnings: null,
94+
invoice_addresses: null)
9395
```
9496

9597

docs/accounting/InvoiceAddress.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# XeroRuby::Accounting::InvoiceAddress
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**invoice_address_type** | **String** | Indicates whether the address is defined as origin (FROM) or destination (TO) | [optional]
8+
**address_line1** | **String** | First line of a physical address | [optional]
9+
**address_line2** | **String** | Second line of a physical address | [optional]
10+
**address_line3** | **String** | Third line of a physical address | [optional]
11+
**address_line4** | **String** | Fourth line of a physical address | [optional]
12+
**city** | **String** | City of a physical address | [optional]
13+
**region** | **String** | Region or state of a physical address | [optional]
14+
**postal_code** | **String** | Postal code of a physical address | [optional]
15+
**country** | **String** | Country of a physical address | [optional]
16+
17+
## Code Sample
18+
19+
```ruby
20+
require 'XeroRuby::Accounting'
21+
22+
instance = XeroRuby::Accounting::InvoiceAddress.new(invoice_address_type: null,
23+
address_line1: null,
24+
address_line2: null,
25+
address_line3: null,
26+
address_line4: null,
27+
city: null,
28+
region: null,
29+
postal_code: null,
30+
country: null)
31+
```
32+
33+

docs/accounting/LineItem.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Name | Type | Description | Notes
1919
**discount_rate** | **BigDecimal** | Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts | [optional]
2020
**discount_amount** | **BigDecimal** | Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts. | [optional]
2121
**repeating_invoice_id** | **String** | The Xero identifier for a Repeating Invoice | [optional]
22+
**taxability** | **String** | The type of taxability | [optional]
23+
**sales_tax_code_id** | **Float** | The ID of the sales tax code | [optional]
24+
**tax_breakdown** | [**Array<TaxBreakdownComponent>**](TaxBreakdownComponent.md) | An array of tax components defined for this line item | [optional]
2225

2326
## Code Sample
2427

@@ -39,7 +42,10 @@ instance = XeroRuby::Accounting::LineItem.new(line_item_id: 00000000-0000-0000-0
3942
tracking: null,
4043
discount_rate: null,
4144
discount_amount: null,
42-
repeating_invoice_id: 00000000-0000-0000-0000-000000000000)
45+
repeating_invoice_id: 00000000-0000-0000-0000-000000000000,
46+
taxability: null,
47+
sales_tax_code_id: null,
48+
tax_breakdown: null)
4349
```
4450

4551

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# XeroRuby::Accounting::TaxBreakdownComponent
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**tax_component_id** | **String** | The unique ID number of this component | [optional]
8+
**type** | **String** | The type of the jurisdiction | [optional]
9+
**name** | **String** | The name of the jurisdiction | [optional]
10+
**tax_percentage** | **Float** | The percentage of the tax | [optional]
11+
**tax_amount** | **Float** | The amount of the tax | [optional]
12+
**taxable_amount** | **Float** | The amount that is taxable | [optional]
13+
**non_taxable_amount** | **Float** | The amount that is not taxable | [optional]
14+
**exempt_amount** | **Float** | The amount that is exempt | [optional]
15+
**state_assigned_no** | **String** | The state assigned number of the jurisdiction | [optional]
16+
**jurisdiction_region** | **String** | Name identifying the region within the country | [optional]
17+
18+
## Code Sample
19+
20+
```ruby
21+
require 'XeroRuby::Accounting'
22+
23+
instance = XeroRuby::Accounting::TaxBreakdownComponent.new(tax_component_id: null,
24+
type: null,
25+
name: null,
26+
tax_percentage: null,
27+
tax_amount: null,
28+
taxable_amount: null,
29+
non_taxable_amount: null,
30+
exempt_amount: null,
31+
state_assigned_no: null,
32+
jurisdiction_region: null)
33+
```
34+
35+

docs/accounting/index.html

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,6 +2564,13 @@
25642564
"items" : {
25652565
"$ref" : "#/components/schemas/ValidationError"
25662566
}
2567+
},
2568+
"InvoiceAddresses" : {
2569+
"type" : "array",
2570+
"description" : "An array of addresses used to auto calculate sales tax",
2571+
"items" : {
2572+
"$ref" : "#/components/schemas/InvoiceAddress"
2573+
}
25672574
}
25682575
},
25692576
"description" : "",
@@ -3259,12 +3266,63 @@
32593266
"items" : {
32603267
"$ref" : "#/components/schemas/ValidationError"
32613268
}
3269+
},
3270+
"InvoiceAddresses" : {
3271+
"type" : "array",
3272+
"description" : "An array of addresses used to auto calculate sales tax",
3273+
"items" : {
3274+
"$ref" : "#/components/schemas/InvoiceAddress"
3275+
}
32623276
}
32633277
},
32643278
"description" : "",
32653279
"externalDocs" : {
32663280
"url" : "http://developer.xero.com/documentation/api/invoices/"
32673281
}
3282+
};
3283+
defs["InvoiceAddress"] = {
3284+
"title" : "",
3285+
"type" : "object",
3286+
"properties" : {
3287+
"InvoiceAddressType" : {
3288+
"type" : "string",
3289+
"description" : "Indicates whether the address is defined as origin (FROM) or destination (TO)",
3290+
"enum" : [ "FROM", "TO" ]
3291+
},
3292+
"AddressLine1" : {
3293+
"type" : "string",
3294+
"description" : "First line of a physical address"
3295+
},
3296+
"AddressLine2" : {
3297+
"type" : "string",
3298+
"description" : "Second line of a physical address"
3299+
},
3300+
"AddressLine3" : {
3301+
"type" : "string",
3302+
"description" : "Third line of a physical address"
3303+
},
3304+
"AddressLine4" : {
3305+
"type" : "string",
3306+
"description" : "Fourth line of a physical address"
3307+
},
3308+
"City" : {
3309+
"type" : "string",
3310+
"description" : "City of a physical address"
3311+
},
3312+
"Region" : {
3313+
"type" : "string",
3314+
"description" : "Region or state of a physical address"
3315+
},
3316+
"PostalCode" : {
3317+
"type" : "string",
3318+
"description" : "Postal code of a physical address"
3319+
},
3320+
"Country" : {
3321+
"type" : "string",
3322+
"description" : "Country of a physical address"
3323+
}
3324+
},
3325+
"description" : ""
32683326
};
32693327
defs["InvoiceReminder"] = {
32703328
"title" : "",
@@ -3660,6 +3718,22 @@
36603718
"description" : "The Xero identifier for a Repeating Invoice",
36613719
"format" : "uuid",
36623720
"example" : "00000000-0000-0000-0000-000000000000"
3721+
},
3722+
"Taxability" : {
3723+
"type" : "string",
3724+
"description" : "The type of taxability",
3725+
"enum" : [ "TAXABLE", "NON_TAXABLE", "EXEMPT", "PART_TAXABLE", "NOT_APPLICABLE" ]
3726+
},
3727+
"SalesTaxCodeId" : {
3728+
"type" : "number",
3729+
"description" : "The ID of the sales tax code"
3730+
},
3731+
"TaxBreakdown" : {
3732+
"type" : "array",
3733+
"description" : "An array of tax components defined for this line item",
3734+
"items" : {
3735+
"$ref" : "#/components/schemas/TaxBreakdownComponent"
3736+
}
36633737
}
36643738
},
36653739
"description" : "",
@@ -5699,6 +5773,55 @@
56995773
"externalDocs" : {
57005774
"url" : "https://developer.xero.com/documentation/api-guides/conversions"
57015775
}
5776+
};
5777+
defs["TaxBreakdownComponent"] = {
5778+
"title" : "",
5779+
"type" : "object",
5780+
"properties" : {
5781+
"TaxComponentId" : {
5782+
"type" : "string",
5783+
"description" : "The unique ID number of this component",
5784+
"format" : "uuid"
5785+
},
5786+
"Type" : {
5787+
"type" : "string",
5788+
"description" : "The type of the jurisdiction",
5789+
"enum" : [ "SYSGST/USCOUNTRY", "SYSGST/USSTATE", "SYSGST/USCOUNTY", "SYSGST/USCITY", "SYSGST/USSPECIAL" ]
5790+
},
5791+
"Name" : {
5792+
"type" : "string",
5793+
"description" : "The name of the jurisdiction"
5794+
},
5795+
"TaxPercentage" : {
5796+
"type" : "number",
5797+
"description" : "The percentage of the tax"
5798+
},
5799+
"TaxAmount" : {
5800+
"type" : "number",
5801+
"description" : "The amount of the tax"
5802+
},
5803+
"TaxableAmount" : {
5804+
"type" : "number",
5805+
"description" : "The amount that is taxable"
5806+
},
5807+
"NonTaxableAmount" : {
5808+
"type" : "number",
5809+
"description" : "The amount that is not taxable"
5810+
},
5811+
"ExemptAmount" : {
5812+
"type" : "number",
5813+
"description" : "The amount that is exempt"
5814+
},
5815+
"StateAssignedNo" : {
5816+
"type" : "string",
5817+
"description" : "The state assigned number of the jurisdiction"
5818+
},
5819+
"JurisdictionRegion" : {
5820+
"type" : "string",
5821+
"description" : "Name identifying the region within the country"
5822+
}
5823+
},
5824+
"description" : ""
57025825
};
57035826
defs["TaxComponent"] = {
57045827
"title" : "",

lib/xero-ruby.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@
466466
require 'xero-ruby/models/accounting/import_summary_object'
467467
require 'xero-ruby/models/accounting/import_summary_organisation'
468468
require 'xero-ruby/models/accounting/invoice'
469+
require 'xero-ruby/models/accounting/invoice_address'
469470
require 'xero-ruby/models/accounting/invoice_reminder'
470471
require 'xero-ruby/models/accounting/invoice_reminders'
471472
require 'xero-ruby/models/accounting/invoices'
@@ -525,6 +526,7 @@
525526
require 'xero-ruby/models/accounting/sales_tracking_category'
526527
require 'xero-ruby/models/accounting/schedule'
527528
require 'xero-ruby/models/accounting/setup'
529+
require 'xero-ruby/models/accounting/tax_breakdown_component'
528530
require 'xero-ruby/models/accounting/tax_component'
529531
require 'xero-ruby/models/accounting/tax_rate'
530532
require 'xero-ruby/models/accounting/tax_rates'

lib/xero-ruby/models/accounting/credit_note.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ class CreditNote
114114
# Displays array of warning messages from the API
115115
attr_accessor :warnings
116116

117+
# An array of addresses used to auto calculate sales tax
118+
attr_accessor :invoice_addresses
119+
117120
class EnumAttributeValidator
118121
attr_reader :datatype
119122
attr_reader :allowable_values
@@ -168,7 +171,8 @@ def self.attribute_map
168171
:'has_attachments' => :'HasAttachments',
169172
:'has_errors' => :'HasErrors',
170173
:'validation_errors' => :'ValidationErrors',
171-
:'warnings' => :'Warnings'
174+
:'warnings' => :'Warnings',
175+
:'invoice_addresses' => :'InvoiceAddresses'
172176
}
173177
end
174178

@@ -204,7 +208,8 @@ def self.openapi_types
204208
:'has_attachments' => :'Boolean',
205209
:'has_errors' => :'Boolean',
206210
:'validation_errors' => :'Array<ValidationError>',
207-
:'warnings' => :'Array<ValidationError>'
211+
:'warnings' => :'Array<ValidationError>',
212+
:'invoice_addresses' => :'Array<InvoiceAddress>'
208213
}
209214
end
210215

@@ -356,6 +361,12 @@ def initialize(attributes = {})
356361
self.warnings = value
357362
end
358363
end
364+
365+
if attributes.key?(:'invoice_addresses')
366+
if (value = attributes[:'invoice_addresses']).is_a?(Array)
367+
self.invoice_addresses = value
368+
end
369+
end
359370
end
360371

361372
# Show invalid properties with the reasons. Usually used together with valid?
@@ -429,7 +440,8 @@ def ==(o)
429440
has_attachments == o.has_attachments &&
430441
has_errors == o.has_errors &&
431442
validation_errors == o.validation_errors &&
432-
warnings == o.warnings
443+
warnings == o.warnings &&
444+
invoice_addresses == o.invoice_addresses
433445
end
434446

435447
# @see the `==` method
@@ -441,7 +453,7 @@ def eql?(o)
441453
# Calculates hash code according to all attributes.
442454
# @return [Integer] Hash code
443455
def hash
444-
[type, contact, date, due_date, status, line_amount_types, line_items, sub_total, total_tax, total, cis_deduction, cis_rate, updated_date_utc, currency_code, fully_paid_on_date, credit_note_id, credit_note_number, reference, sent_to_contact, currency_rate, remaining_credit, allocations, applied_amount, payments, branding_theme_id, status_attribute_string, has_attachments, has_errors, validation_errors, warnings].hash
456+
[type, contact, date, due_date, status, line_amount_types, line_items, sub_total, total_tax, total, cis_deduction, cis_rate, updated_date_utc, currency_code, fully_paid_on_date, credit_note_id, credit_note_number, reference, sent_to_contact, currency_rate, remaining_credit, allocations, applied_amount, payments, branding_theme_id, status_attribute_string, has_attachments, has_errors, validation_errors, warnings, invoice_addresses].hash
445457
end
446458

447459
# Builds the object from hash

0 commit comments

Comments
 (0)