Issue with Leave API Removing Other Earnings Line Items from Payslip
When we use the API to post Leave entries from our application, other earnings line items in the payslip are being removed.
This issue occurs specifically when the Leave falls within the same fortnightly pay period after the payslip has been created for the employee.
Example:
An employee has the following earnings on their payslip:
- Ordinary Hours
- Overtime Hours
- Bonus
After we send the Leave entry via the API, the Overtime Hours and/or Bonus earnings line items are removed from the payslip, leaving only the Ordinary Hours.
This behavior seems unintended, as adding a Leave entry should not impact other earnings line items.
Steps to Reproduce:
1. Create a payslip for an employee with multiple earnings line items (e.g., Ordinary Hours, Overtime Hours, Bonus).
2. Post a Leave entry via the Xero Leave API for a date within the same pay period.
3. Observe that one or more of the other earnings line items (e.g., Overtime Hours, Bonus) are removed from the payslip.
Expected Behavior:
Adding a Leave entry via the API should not modify or remove other earnings line items from the payslip.
