xero-node
Advanced tools
Comparing version 2.12.0 to 2.13.0
@@ -19,3 +19,3 @@ The following examples explain the Bank Transactions section of the SDK. The API documentation on Bank Transactions can be found [here](https://developer.xero.com/documentation/api/banktransactions). | ||
* `newBankTransaction(data[, options])` | ||
* `newBankTransactions(data)` | ||
* `saveBankTransactions(data)` | ||
* `getBankTransaction(id[, modifiedAfter])` | ||
@@ -101,3 +101,3 @@ * `getBankTransactions([options])` | ||
xeroClient.core.bankTransactions.newBankTransactions(bankTransactions) | ||
xeroClient.core.bankTransactions.saveBankTransactions(bankTransactions) | ||
.then(function(response) { | ||
@@ -180,2 +180,2 @@ //Bank Transactions have been created | ||
}) | ||
``` | ||
``` |
@@ -74,17 +74,2 @@ The following examples explain the Tax Rates section of the SDK. The API documentation on Tax Rates can be found [here](https://developer.xero.com/documentation/api/tax-rates). | ||
### Retrieving Tax Rate by ID | ||
This example shows how to retrieve an tax rate using the Xero supplied GUID. | ||
```javascript | ||
var myTaxRateID = '288762e4-67a9-442d-9956-9a14e9d8826e'; | ||
xeroClient.core.taxRates.getTaxRate(myTaxRateID) | ||
.then(function(taxrate) { | ||
//We've got the tax rate so do something useful | ||
console.log(taxrate.Name); | ||
}); | ||
``` | ||
### Retrieving Tax Rates with filters | ||
@@ -134,5 +119,5 @@ | ||
var someTaxRateID = '75520d2e-e19d-4f36-b19b-e3b9000b2daa'; | ||
var someTaxRateName = 'tax001'; | ||
xeroClient.core.taxRates.getTaxRate(someTaxRateID) | ||
xeroClient.core.taxRates.getTaxRate(someTaxRateName) | ||
.then(function(taxrate) { | ||
@@ -148,2 +133,2 @@ //We've got the tax rate so now let's change Name | ||
}); | ||
``` | ||
``` |
@@ -240,3 +240,3 @@ 'use strict'; | ||
var errObj = new Error('DELETE call failed with: ' + err.statusCode); | ||
errObj.data = data; | ||
errObj.data = err.data; | ||
reject(errObj); | ||
@@ -282,3 +282,3 @@ callback && callback(errObj); | ||
var errObj = new Error('GET call failed with: ' + err.statusCode); | ||
errObj.data = data; | ||
errObj.data = err.data; | ||
reject(errObj); | ||
@@ -311,2 +311,6 @@ callback && callback(errObj); | ||
if (options.unitdp) { | ||
params.unitdp = options.unitdp; | ||
} | ||
if (!_.isEmpty(params)) { | ||
@@ -384,3 +388,3 @@ url += '?' + querystring.stringify(params); | ||
var errObj = new Error('GET call failed with: ' + err.statusCode); | ||
errObj.data = data; | ||
errObj.data = err.data; | ||
reject(errObj); | ||
@@ -387,0 +391,0 @@ callback && callback(errObj); |
@@ -41,2 +41,3 @@ var _ = require('lodash'), | ||
CreditNoteNumber: { type: String, toObject: 'hasValue' }, | ||
Reference: { type: String, toObject: 'hasValue' }, | ||
CurrencyRate: { type: Number, toObject: 'hasValue' }, | ||
@@ -43,0 +44,0 @@ RemainingCredit: { type: Number, toObject: 'hasValue' }, |
@@ -16,4 +16,4 @@ var _ = require('lodash'), | ||
}, | ||
getInvoice: function(id, modifiedAfter, where, order) { | ||
return this.getInvoices({ id: id, modifiedAfter: modifiedAfter, where: where, order: order }) | ||
getInvoice: function(id, modifiedAfter, where, order, unitdp) { | ||
return this.getInvoices({ id: id, modifiedAfter: modifiedAfter, where: where, order: order, unitdp: unitdp }) | ||
.then(function(invoices) { | ||
@@ -20,0 +20,0 @@ return _.first(invoices); |
@@ -8,3 +8,3 @@ var _ = require('lodash'), | ||
constructor: function(application, options) { | ||
EntityHelper.call(this, application, Object.assign({ entityName: 'Employee', entityPlural: 'Employees' }, options)); | ||
EntityHelper.call(this, application, Object.assign({ entityPlural: 'Employees' }, options)); | ||
}, | ||
@@ -11,0 +11,0 @@ newEmployee: function(data, options) { |
@@ -8,3 +8,3 @@ var _ = require('lodash'), | ||
constructor: function(application, options) { | ||
EntityHelper.call(this, application, Object.assign({ entityName: 'Timesheet', entityPlural: 'Timesheets' }, options)); | ||
EntityHelper.call(this, application, Object.assign({ entityPlural: 'Timesheets' }, options)); | ||
}, | ||
@@ -11,0 +11,0 @@ newTimesheet: function(data, options) { |
{ | ||
"name": "xero-node", | ||
"version": "2.12.0", | ||
"version": "2.13.0", | ||
"description": "Xero API Wrapper for all application types", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -230,2 +230,8 @@ xero-node (alpha) | ||
* 2.13.0 | ||
- Merged Fixed Payroll Timesheet Entity Helper #148 | ||
- Merged Fixed bug in Payroll Employee Entity #147 | ||
- Merged Fix error references #145 | ||
- Merged Reference field added to creditnote schema #143 | ||
- Merged Added unitdp to GetInvoice #142 | ||
* 2.12.0 | ||
@@ -232,0 +238,0 @@ - Merged #139 - Options on Manual Journals and using ManualJournalID |
@@ -148,2 +148,6 @@ 'use strict'; | ||
} | ||
if (creditNote.Reference) { | ||
expect(creditNote.Reference).to.be.a('String'); | ||
} | ||
}); | ||
@@ -309,2 +313,6 @@ done(); | ||
} | ||
if (creditNote.Reference) { | ||
expect(creditNote.Reference).to.be.a('String'); | ||
} | ||
done(); | ||
@@ -368,2 +376,4 @@ }) | ||
expect(thisNote.Reference).to.equal(creditNoteData.Reference); | ||
done(); | ||
@@ -370,0 +380,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
736315
11863
482
162