Xero NZ Payroll API : Employee number vs GUID? - xero-api

Most payroll systems have some sort of employee code that is unique to employees.
I have been using the Employees endpoint to GET all employees in the Demo company and can see the EmployeeID field which appears to be a regular GUID.
But when browsing the employee list through the Xero user interface it is not possible to see an employee's GUID like we can for Contacts or Invoices?
I actually just see a number like this... What is this number at the end of the URL?
https://payroll.xero.com/Employee?CID=!tkSD3#employees/12345678

It looks like this has been an issue with Xero since 2015 that has still not been resolved!
https://community.xero.com/developer/discussion/12133203/

Related

Email the Sales team their monthly Commission at an Order level

I am trying to find a way in SQL which would send email either as excel attachment or html to the Sales Teams on how much monthly commission did they earn on each order. Since it is commission, due to security reasons I cannot send a common file to everyone to look at each others commissions. Trying to put the scenario in a tabular form for a better understanding.
The first table gives you at an Order level who is getting paid how much. Which I already have in place
This table gives how much commission is paid individually and should email the same results to respective Sales Person based on Email address listed in 1st table

Xero previewer not displaying Employees

I am setting up a Xero payroll integration using an Australian demo company. I have set up a private api key and using the previewer to check the responses to retrieving all employees.
There are 6 test employees and when I use the following endpoint https://api.xero.com/api.xro/2.0/employees no employee data is returned but I get a 200 response.
If I post data through the Previewer using the same endpoint, contacts are successfully created but are not in the Payroll Employees list but rather in the contacts list.
Using a get on the above endpoint after this point will then return any Employee created through the Post in the Previewer. Those alone.
When I set up the API key there was an option to enable for Payroll and I did do this.
Anyone know why I'm not getting the 6 Employees in the Employee list please?
Many thanks
Cath
found it: wrong endpoint was being used. This was the correct one.
https://api.xero.com/payroll.xro/1.0/Employees

Using parameters to limit user access in SQL / Reporting Services

I'm looking at finding a way of restricting access to certain parts of a report using a parameter but I've yet to find a way to do this.
What I want to do is have the report get the persons username and then restrict what options they have available to them in the other parameters of the report.
For example, John is a manager of the Call Centre department so John
shouldn't see the options for the other departments in the business
and should only see the 'Call Centre' option in the Department
parameter.
Is this possible? If it isn't, is there an alternative using something similar?
First you'll need someway of determining who shoudl be able to see what. At it's simplest you could build a table to do this with Users and Departments.
Then create a dataset in your report that returns only values departments, something like
SELECT DepartmentID, DepartmentName FROM UserDepartments WHERE UserName = SYSTEM_USER
I've used SYSTEM_USER here but this will only work if you are executing the dataset with windows authentication.
Then in your Department parameter, just set the available values to the dataset you just created.

Retrieval of all the invoices of particular contact id in xero

In xero, if we create a contact. Using that contact we perform couple of sales invoice and purchase bills and few of them get paid. Now I want to obtain the list of the invoices groupedBy ContactID in php
Xero have recently released functionality that allows this in an easy way.
You can use the ContactIDs query parameter on the invoices endpoint like the following:
GET ../Invoices?ContactIDs=623e392d-7402-40e4-a54c-fdf29783e9a4
You can also do this for more than one ContactID by supplying a comma separated list of ContactIDs.
You can find more information about this in this handy blog post

Access controls list "Editing Odoo security rules"

I'm trying to modify the access control list of Leave Requests to approve under Leave managements module.
I need to make the Leave Requests to approve menu only accessed by each employee's manager.
ea. if the company has 10 employees under Sales/marketing and 5 employees under IT department. I need the sales manager access his 10 employees' leave requests only and not able to access the rest of company's employees who are not under his authority.
To do it, I modified the record rule domain definition of Leaves officer from [(1,'=',1)] to [('employee_id.parent_id,'=',user.id)]
but it didn't work. How to fix it?
In Your case basically your are totally pass the wrong domain for the record rules.
You are previously using the domain like
[(1,'=',1)] = > Access the all the model record for that model
[('employee_id.parent_id,'=',user.id)] = > Access the Manager parent_id as current user employee only
But in your are accessing only with the manager user only not to access its related user.
so you must have to add the below domain in your record rules:
['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id)]
Basically the manager its self as employee of the company and employee having to attached with its related user.
first Need to understand the following relation :
1. employee_id :
which is indicate the each leave related with one employee.
2. parent_id :
which is indicate the each employee related with one manager for hr.holidays model w[('employee_id.parent_id,'=',user.id)]particular model.hich is called the leave request
3. user_id :
If you want to access the login to the particular employee then and then you must have to set the related user for each employee form.which is labeled as Related User.
4. user :
Which is indicate the global user name means current user which you are currently logged in.
5.id :
means unique id for each record
In your case how the domain will work ?
first it will check the current logged in user as attached current leave employee related user or not.
and then then find the user ids which are having with the same employee attached with the same managers.
It means it will perform the OR operation of SQL Statement for both of the domain.
I hope my answer may helpful for you :)