Allow overlapping recurring Additional Salary for different Employee Advances
Problem
Ticket #78414
The system currently blocks creating a second recurring Additional Salary (e.g. Advance Return) for the same employee and salary component if the dates overlap with an existing one - even when the two records belong to different Employee Advances. This means an employee with two separate advances can't have both repayment schedules active at the same time, even though they're unrelated deductions.
Screenshot attached showing the error.
Proposed Solution
Allow overlapping recurring Additional Salary records when they are linked to different Employee Advances (ref_docname), while still blocking overlaps for the same advance or for records with no advance link (to preserve current behavior elsewhere).
I've already implemented and tested this fix, including a new test case (test_additional_salary_overlap_allowed_for_different_employee_advance) covering both the allowed and still-blocked scenarios. All existing tests pass.
- Branch: https://github.com/AbdullahAnsari-03/hrms/tree/feat-multiple-employee-advance
- Diff: https://github.com/frappe/hrms/compare/develop...AbdullahAnsari-03:hrms:feat-multiple-employee-advance?diff=unified&w
Happy to open a PR once the code owner verifies the changes and provides feedback. Thankyou!
Source: frappe/hrms