-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Payroll API Branch #76
Comments
fyi, the PHP and .NET APIs have been updated - https://community.xero.com/developer/discussion/1636240 Can I help with anything on the implementation of this? I'm keen to see it up and running as soon as possible! |
Happy to have some help on this as I have been swamped with other things. You can look in the Ultimately, because they've changed the API endpoint and there are some clashes in the namespaces, payroll has had to be implemented almost as a separate API. I have done this via extending the existing record base classes to be payroll-specific and created a way to return a payroll endpint from an existing Xero one. For example: require "pp"
require "logger"
require File.dirname(__FILE__) + "/../lib/xeroizer"
xero = Xeroizer::PrivateApplication.new(
XERO_AUTH,
XERO_KEY,
XERO_PK_FILE
)
xero.logger = Logger.new(STDOUT)
payroll = xero.payroll
employees = payroll.Employee.all I have created Employee, BankAccount and HomeAddress models so far (the easy ones), but there are a lot of object types in the new API that are mixed together that may also require underlying changes to the way the associations work, although maybe I was reading into this too much when I first read through the API at http://developer.xero.com/payroll-api |
You were right, there are a few schema changes. I started with Timesheets since that's the model I need most. The timesheet model has many "timesheet lines" (http://developer.xero.com/payroll-api/Timesheets/#TimesheetLines), each of which seems to have one "number of units". This is then made up of several "NumberOfUnit" elements. I ended up adding another association type - Annoyingly, the only official Xero library - the .NET one - has the tests for new timesheets incomplete and commented out (see https://github.com/XeroAPI/XeroAPI.Net/blob/payroll/source/XeroApi.ConsoleTests/Payroll/PayrollApiWrite.cs#L17). So I didn't have much to go by. I'm going to email them and ask if there will be more examples. |
I've added PayItems (and LeaveApplications, though that's still a work in progress): https://github.com/ghiculescu/xeroizer/commit/27af99ff82bf31a4a45d5dd6ef978ef10ee0b283 I added a new One thing I wanted to ask you; there are quite a few tests that fail on code that says:
With error:
These tests fail on the master branch too. I haven't attempted to fix them yet; just wanted to know if you were aware of this? |
Hi @waynerobinson - just wondering if you had a chance to take a look at this? |
Hi @waynerobinson, I've tried the payroll branch, read of Employee, BankAccount and HomeAddress works, attempt to write crashes. Do you plan to continue Xero Payroll API implementation? |
Hi @layby42, I wasn't aware of a crash on writes. Can you please give some example code and I will look into it. I've been using the payroll branch in production but currently we only write Timesheets (which explains why the wrapper isn't complete - I would like to see it done one day!) |
yes, here it is (the data is valid employee from Demo Company):
here is the trace: |
Create employee seem to be OK (first & last name); trying to find out how to add HomeAddress and BankAccount update: BankAccount: add_bank_account (just like add_line_item to invoice); create with BankAccount results into Net::HTTPBadRequest 400 Bad Request readbody=true so the problem is with posting employee with nested elements like bank account(s) or home address |
This branch is an extremely early version of payroll support and no where I will definitely be supporting Payroll in the future, but I've not had any I'm always happy to review and merge pull requests. The best people to On Thursday, September 5, 2013, Oxana Goutnik wrote:
|
Hi @waynerobinson, I'm working on update for payroll branch. |
Cool. On 5 September 2013 10:39, Oxana Goutnik notifications@github.com wrote:
|
Hi @layby42, had any luck? I was going to have a look into it otherwise. It looks like the issue is only coming when loading |
yes, there were 3 issues:
current status: create & update data works; everything goes to Xero without issues; have to finish with reading has_one (home_address) from Xero API properly and implement tests. If you'd like to look into it yourself as well, please do -) |
https://github.com/syreclabs/xeroizer, payroll branch is relatively OK, we are using it on production. Fixed several bugs in my last pull request that was committed to waynerobinson/xeroizer payroll, has bank_account, tax_declaration, super funds, superannuation memberships. Also rebased on current waynerobinson/xeroizer master. |
Feel free to submit these back to here if you like. |
What's the status on the payroll branch? Could I use that branch and support both Accounting and Payroll ? |
So, I tentatively merged some of the payroll work to master; stuck a 3.0.0-beta on the version and prepped a PR (wildly untested) in #492. |
I have started a branch (called payroll) for implementing the upcoming Xero Payroll API into Xeroizer.
This is created under a completely separate endpoint and will require some significant refactoring to implement given some of the new complex data structures and the addition of response paging.
The text was updated successfully, but these errors were encountered: