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

feat: Leave Encashment Enhancements #817

Merged
merged 11 commits into from
Oct 23, 2023

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Aug 23, 2023

no-docs (temp)

  • Add Maximum Encashable Leaves setting in Leave Type
  • Refactor: reorder function calls for correctness
  • Allow overwriting encashable days
  • Inform the user about the calculation based on threshold and max leaves setting
  • Enable Allow on Submit for Encashment Amount in Salary Structure
  • Enable Non Negative checks for settings
  • Tests
  • Encashment threshold functionality naming makes no sense Issue with Leave Encashment #420, fix: Leave Encashment calculations erpnext#31062 (comment)
  • Rethink correlation and effect with CF leaves and existing allocation

Closes #921

Leave Type

  • Added a setting for Maximum Encashable Leaves
  • Renamed Encashment Threshold Days -> Non-Encashable Leaves because it indicates the number of leaves that cannot be encashed
image

Leave Encashment

image

Instead of making Encashable Days directly editable - since its value is primarily derived from the leave balance & leave type settings:

  • Added Actual Encashable Days: Denotes the number of leaves eligible for encashment based on leave type settings

    • This gets auto-calculated: e.g: leave balance = 10, non-encashable leaves = 3, max encashable leaves = 5
    • Then Actual Encashable Days = 5 (10 - 3 = 7, but max is 5)
  • Added Encashment Days: By default set to actual encashable days but the user can choose to overwrite this to encash less number of leaves than the actual encashable days value. Added validations and msgprints for the same

    image image
  • Patch for setting the above fields = encashable days (old field)

@ruchamahabal ruchamahabal force-pushed the enhance-leave-encashment branch from f30cd8d to 4c6abcf Compare August 23, 2023 10:05
@ruchamahabal ruchamahabal changed the title feat: add Maximum Encashable Leaves setting in Leave Type feat: Leave Encashment Enhancements Aug 23, 2023
@codecov-commenter
Copy link

codecov-commenter commented Aug 23, 2023

Codecov Report

Merging #817 (8a66ce2) into develop (a8501ea) will increase coverage by 0.04%.
Report is 12 commits behind head on develop.
The diff coverage is 96.49%.

@@             Coverage Diff             @@
##           develop     #817      +/-   ##
===========================================
+ Coverage    73.83%   73.88%   +0.04%     
===========================================
  Files          195      195              
  Lines        10397    10412      +15     
===========================================
+ Hits          7677     7693      +16     
+ Misses        2720     2719       -1     
Files Coverage Δ
...ms/hr/doctype/leave_encashment/leave_encashment.py 83.33% <97.05%> (+4.50%) ⬆️
hrms/payroll/doctype/salary_slip/salary_slip.py 86.75% <95.65%> (-0.03%) ⬇️

@ruchamahabal ruchamahabal force-pushed the enhance-leave-encashment branch from a9b521f to 4b52caa Compare October 23, 2023 08:43
@ruchamahabal ruchamahabal marked this pull request as ready for review October 23, 2023 10:22
@ruchamahabal ruchamahabal force-pushed the enhance-leave-encashment branch from 5e29d25 to 1b66524 Compare October 23, 2023 13:11
@ruchamahabal
Copy link
Member Author

Tests passed but coverage upload failed. Merging

@ruchamahabal ruchamahabal merged commit 1607f9a into frappe:develop Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Leave Encashment
2 participants