Skip to content
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

fix: choose correct Salary Structure Assignment when getting data for formula eval #25876

Merged
merged 5 commits into from
Jun 8, 2021

Conversation

sagarvora
Copy link
Collaborator

@sagarvora sagarvora commented May 28, 2021

Resolves #24601
Resolves #21307

Changes Made

  • Improved validation for Payroll Period to see if employee hasn't joined or has already left
  • Choosing correct salary structure with following additional filters:
    • Salary Structure Assignment's From Date should be less than or equal to (Payroll Period Start Date or Employee Joining Date whichever is later)
    • Salary Structure Assignment should be submitted
  • Gets the Salary Structure Assignment with From Date closest to Payroll Start Date / Employee Joining Date instead of choosing the one which was last modified (order_by)
  • Error message if Salary Structure Assignment with above filters not found

@sagarvora sagarvora force-pushed the fix-ssa-selection branch 4 times, most recently from f740087 to 618c3c7 Compare May 28, 2021 19:17
@sagarvora sagarvora marked this pull request as ready for review May 28, 2021 19:30
@sagarvora
Copy link
Collaborator Author

Changes have been tested locally.

@ruchamahabal ruchamahabal self-assigned this Jun 4, 2021
@sagarvora
Copy link
Collaborator Author

Breaking tests are unrelated. Directly linked tests have been fixed.

Comment on lines +144 to +145
if not from_date and payroll_period:
from_date = payroll_period.start_date
Copy link
Collaborator Author

@sagarvora sagarvora Jun 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This code has been added because after newly introduced validation, a Salary Structure Assignment must be applicable on or before the Salary Slip date.
  • This code assumes that employee has joined before Payroll Period. Alternatively, from_date can be manually passed to make_salary_structure in these cases.

@ruchamahabal
Copy link
Member

LGTM

@ruchamahabal ruchamahabal merged commit f393934 into frappe:develop Jun 8, 2021
@ruchamahabal
Copy link
Member

@sagarvora Can you also raise a fix for version-13-hotfix branch?

asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
fix: choose correct Salary Structure Assignment when getting data for formula eval
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants