Skip to content

Commit

Permalink
[UST-4371] Add USST fields to Invoices and Credit Notes endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Sep 16, 2024
1 parent 8bd9795 commit 87ce461
Show file tree
Hide file tree
Showing 6 changed files with 1,582 additions and 15 deletions.
123 changes: 123 additions & 0 deletions docs/v2/accounting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2564,6 +2564,13 @@
"items" : {
"$ref" : "#/components/schemas/ValidationError"
}
},
"InvoiceAddresses" : {
"type" : "array",
"description" : "An array of addresses used to auto calculate sales tax",
"items" : {
"$ref" : "#/components/schemas/InvoiceAddress"
}
}
},
"description" : "",
Expand Down Expand Up @@ -3259,12 +3266,63 @@
"items" : {
"$ref" : "#/components/schemas/ValidationError"
}
},
"InvoiceAddresses" : {
"type" : "array",
"description" : "An array of addresses used to auto calculate sales tax",
"items" : {
"$ref" : "#/components/schemas/InvoiceAddress"
}
}
},
"description" : "",
"externalDocs" : {
"url" : "http://developer.xero.com/documentation/api/invoices/"
}
};
defs["InvoiceAddress"] = {
"title" : "",
"type" : "object",
"properties" : {
"InvoiceAddressType" : {
"type" : "string",
"description" : "Indicates whether the address is defined as origin (FROM) or destination (TO)",
"enum" : [ "FROM", "TO" ]
},
"AddressLine1" : {
"type" : "string",
"description" : "First line of a physical address"
},
"AddressLine2" : {
"type" : "string",
"description" : "Second line of a physical address"
},
"AddressLine3" : {
"type" : "string",
"description" : "Third line of a physical address"
},
"AddressLine4" : {
"type" : "string",
"description" : "Fourth line of a physical address"
},
"City" : {
"type" : "string",
"description" : "City of a physical address"
},
"Region" : {
"type" : "string",
"description" : "Region or state of a physical address"
},
"PostalCode" : {
"type" : "string",
"description" : "Postal code of a physical address"
},
"Country" : {
"type" : "string",
"description" : "Country of a physical address"
}
},
"description" : ""
};
defs["InvoiceReminder"] = {
"title" : "",
Expand Down Expand Up @@ -3660,6 +3718,22 @@
"description" : "The Xero identifier for a Repeating Invoice",
"format" : "uuid",
"example" : "00000000-0000-0000-0000-000000000000"
},
"Taxability" : {
"type" : "string",
"description" : "The type of taxability",
"enum" : [ "TAXABLE", "NON_TAXABLE", "EXEMPT", "PART_TAXABLE", "NOT_APPLICABLE" ]
},
"SalesTaxCodeId" : {
"type" : "number",
"description" : "The ID of the sales tax code"
},
"TaxBreakdown" : {
"type" : "array",
"description" : "An array of tax components defined for this line item",
"items" : {
"$ref" : "#/components/schemas/TaxBreakdownComponent"
}
}
},
"description" : "",
Expand Down Expand Up @@ -5699,6 +5773,55 @@
"externalDocs" : {
"url" : "https://developer.xero.com/documentation/api-guides/conversions"
}
};
defs["TaxBreakdownComponent"] = {
"title" : "",
"type" : "object",
"properties" : {
"TaxComponentId" : {
"type" : "string",
"description" : "The unique ID number of this component",
"format" : "uuid"
},
"Type" : {
"type" : "string",
"description" : "The type of the jurisdiction",
"enum" : [ "SYSGST/USCOUNTRY", "SYSGST/USSTATE", "SYSGST/USCOUNTY", "SYSGST/USCITY", "SYSGST/USSPECIAL" ]
},
"Name" : {
"type" : "string",
"description" : "The name of the jurisdiction"
},
"TaxPercentage" : {
"type" : "number",
"description" : "The percentage of the tax"
},
"TaxAmount" : {
"type" : "number",
"description" : "The amount of the tax"
},
"TaxableAmount" : {
"type" : "number",
"description" : "The amount that is taxable"
},
"NonTaxableAmount" : {
"type" : "number",
"description" : "The amount that is not taxable"
},
"ExemptAmount" : {
"type" : "number",
"description" : "The amount that is exempt"
},
"StateAssignedNo" : {
"type" : "string",
"description" : "The state assigned number of the jurisdiction"
},
"JurisdictionRegion" : {
"type" : "string",
"description" : "Name identifying the region within the country"
}
},
"description" : ""
};
defs["TaxComponent"] = {
"title" : "",
Expand Down
43 changes: 38 additions & 5 deletions lib/Models/Accounting/CreditNote.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ class CreditNote implements ModelInterface, ArrayAccess
'has_attachments' => 'bool',
'has_errors' => 'bool',
'validation_errors' => '\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]',
'warnings' => '\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]'
'warnings' => '\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]',
'invoice_addresses' => '\XeroAPI\XeroPHP\Models\Accounting\InvoiceAddress[]'
];

/**
Expand Down Expand Up @@ -125,7 +126,8 @@ class CreditNote implements ModelInterface, ArrayAccess
'has_attachments' => null,
'has_errors' => null,
'validation_errors' => null,
'warnings' => null
'warnings' => null,
'invoice_addresses' => null
];

/**
Expand Down Expand Up @@ -184,7 +186,8 @@ public static function openAPIFormats()
'has_attachments' => 'HasAttachments',
'has_errors' => 'HasErrors',
'validation_errors' => 'ValidationErrors',
'warnings' => 'Warnings'
'warnings' => 'Warnings',
'invoice_addresses' => 'InvoiceAddresses'
];

/**
Expand Down Expand Up @@ -222,7 +225,8 @@ public static function openAPIFormats()
'has_attachments' => 'setHasAttachments',
'has_errors' => 'setHasErrors',
'validation_errors' => 'setValidationErrors',
'warnings' => 'setWarnings'
'warnings' => 'setWarnings',
'invoice_addresses' => 'setInvoiceAddresses'
];

/**
Expand Down Expand Up @@ -260,7 +264,8 @@ public static function openAPIFormats()
'has_attachments' => 'getHasAttachments',
'has_errors' => 'getHasErrors',
'validation_errors' => 'getValidationErrors',
'warnings' => 'getWarnings'
'warnings' => 'getWarnings',
'invoice_addresses' => 'getInvoiceAddresses'
];

/**
Expand Down Expand Up @@ -391,6 +396,7 @@ public function __construct(array $data = null)
$this->container['has_errors'] = isset($data['has_errors']) ? $data['has_errors'] : false;
$this->container['validation_errors'] = isset($data['validation_errors']) ? $data['validation_errors'] : null;
$this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null;
$this->container['invoice_addresses'] = isset($data['invoice_addresses']) ? $data['invoice_addresses'] : null;
}

/**
Expand Down Expand Up @@ -1342,6 +1348,33 @@ public function setWarnings($warnings)
}



/**
* Gets invoice_addresses
*
* @return \XeroAPI\XeroPHP\Models\Accounting\InvoiceAddress[]|null
*/
public function getInvoiceAddresses()
{
return $this->container['invoice_addresses'];
}

/**
* Sets invoice_addresses
*
* @param \XeroAPI\XeroPHP\Models\Accounting\InvoiceAddress[]|null $invoice_addresses An array of addresses used to auto calculate sales tax
*
* @return $this
*/
public function setInvoiceAddresses($invoice_addresses)
{

$this->container['invoice_addresses'] = $invoice_addresses;

return $this;
}


/**
* Returns true if offset exists. False otherwise.
*
Expand Down
43 changes: 38 additions & 5 deletions lib/Models/Accounting/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class Invoice implements ModelInterface, ArrayAccess
'has_errors' => 'bool',
'status_attribute_string' => 'string',
'validation_errors' => '\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]',
'warnings' => '\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]'
'warnings' => '\XeroAPI\XeroPHP\Models\Accounting\ValidationError[]',
'invoice_addresses' => '\XeroAPI\XeroPHP\Models\Accounting\InvoiceAddress[]'
];

/**
Expand Down Expand Up @@ -145,7 +146,8 @@ class Invoice implements ModelInterface, ArrayAccess
'has_errors' => null,
'status_attribute_string' => null,
'validation_errors' => null,
'warnings' => null
'warnings' => null,
'invoice_addresses' => null
];

/**
Expand Down Expand Up @@ -214,7 +216,8 @@ public static function openAPIFormats()
'has_errors' => 'HasErrors',
'status_attribute_string' => 'StatusAttributeString',
'validation_errors' => 'ValidationErrors',
'warnings' => 'Warnings'
'warnings' => 'Warnings',
'invoice_addresses' => 'InvoiceAddresses'
];

/**
Expand Down Expand Up @@ -262,7 +265,8 @@ public static function openAPIFormats()
'has_errors' => 'setHasErrors',
'status_attribute_string' => 'setStatusAttributeString',
'validation_errors' => 'setValidationErrors',
'warnings' => 'setWarnings'
'warnings' => 'setWarnings',
'invoice_addresses' => 'setInvoiceAddresses'
];

/**
Expand Down Expand Up @@ -310,7 +314,8 @@ public static function openAPIFormats()
'has_errors' => 'getHasErrors',
'status_attribute_string' => 'getStatusAttributeString',
'validation_errors' => 'getValidationErrors',
'warnings' => 'getWarnings'
'warnings' => 'getWarnings',
'invoice_addresses' => 'getInvoiceAddresses'
];

/**
Expand Down Expand Up @@ -463,6 +468,7 @@ public function __construct(array $data = null)
$this->container['status_attribute_string'] = isset($data['status_attribute_string']) ? $data['status_attribute_string'] : null;
$this->container['validation_errors'] = isset($data['validation_errors']) ? $data['validation_errors'] : null;
$this->container['warnings'] = isset($data['warnings']) ? $data['warnings'] : null;
$this->container['invoice_addresses'] = isset($data['invoice_addresses']) ? $data['invoice_addresses'] : null;
}

/**
Expand Down Expand Up @@ -1713,6 +1719,33 @@ public function setWarnings($warnings)
}



/**
* Gets invoice_addresses
*
* @return \XeroAPI\XeroPHP\Models\Accounting\InvoiceAddress[]|null
*/
public function getInvoiceAddresses()
{
return $this->container['invoice_addresses'];
}

/**
* Sets invoice_addresses
*
* @param \XeroAPI\XeroPHP\Models\Accounting\InvoiceAddress[]|null $invoice_addresses An array of addresses used to auto calculate sales tax
*
* @return $this
*/
public function setInvoiceAddresses($invoice_addresses)
{

$this->container['invoice_addresses'] = $invoice_addresses;

return $this;
}


/**
* Returns true if offset exists. False otherwise.
*
Expand Down
Loading

0 comments on commit 87ce461

Please sign in to comment.