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: Earned Leave allocation based on joining date fixes #29711

Merged
merged 7 commits into from
Feb 11, 2022

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Feb 8, 2022

Earned Leave allocation based on joining date not working due to incorrect field name. This is wrong right from the time the feature was introduced in #23112

Field name is based_on_date_of_joining.
image

Code was trying to access based_on_date_of_joining_date

Different Cases for Leave Policy Assignment:

Based on Joining Date with based_on_date_of_joining disabled in Leave Type

  • Should set Effective From = DOJ
  • Should allocate leaves at the end of every month
  • If the assignment is happening on the last day of the month, should consider that month in total leaves allocated too

Based on Leave Period with based_on_date_of_joining disabled in Leave Type

  • Should set Effective From = Start date of Leave Period
  • Should allocate leaves at the end of every month
  • If the assignment is happening on the last day of the month, should consider that month in total leaves allocated too

Based on Joining Date with based_on_date_of_joining enabled in Leave Type

  • Should set Effective From = DOJ
  • Should grant leaves on the day of joining every month (eg: DOJ=12th, so allocation should happen on 12th of every month)
  • If the assignment is happening on the day of joining of the month, should consider that month in total leaves allocated too

Based on Leave Period with based_on_date_of_joining enabled in Leave Type

  • Should set Effective From = Start date of Leave Period
  • Should grant leaves on the day of joining every month (eg: DOJ=12th, so allocation should happen on 12th of every month)
  • If the assignment is happening on the day of joining of the month, should consider that month in total leaves allocated too

@github-actions github-actions bot added HR needs-tests This PR needs automated unit-tests. labels Feb 8, 2022
@ruchamahabal ruchamahabal force-pushed the leave-policy-assgn-fixes branch from 51b39a8 to c7be9ef Compare February 11, 2022 08:22
@ruchamahabal ruchamahabal removed the needs-tests This PR needs automated unit-tests. label Feb 11, 2022
@ruchamahabal ruchamahabal marked this pull request as ready for review February 11, 2022 15:30
@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #29711 (10ee2fb) into develop (86ef932) will increase coverage by 0.19%.
The diff coverage is 96.29%.

@@             Coverage Diff             @@
##           develop   #29711      +/-   ##
===========================================
+ Coverage    58.87%   59.06%   +0.19%     
===========================================
  Files         1112     1112              
  Lines        69553    69556       +3     
===========================================
+ Hits         40948    41082     +134     
+ Misses       28605    28474     -131     
Impacted Files Coverage Δ
...leave_policy_assignment/leave_policy_assignment.py 89.74% <95.65%> (+2.02%) ⬆️
erpnext/hr/utils.py 76.77% <100.00%> (+0.37%) ⬆️
...work_order_stock_report/work_order_stock_report.py 50.00% <0.00%> (-50.00%) ⬇️
...payroll/doctype/income_tax_slab/income_tax_slab.py 83.33% <0.00%> (-16.67%) ⬇️
...t/accounts/report/sales_register/sales_register.py 73.33% <0.00%> (-7.28%) ⬇️
.../manufacturing/report/bom_explorer/bom_explorer.py 94.44% <0.00%> (-5.56%) ⬇️
erpnext/education/doctype/student/student.py 73.68% <0.00%> (-3.16%) ⬇️
...pnext/accounts/report/gross_profit/gross_profit.py 82.49% <0.00%> (-3.12%) ⬇️
...ion/doctype/course_enrollment/course_enrollment.py 44.00% <0.00%> (-2.00%) ⬇️
...eorder_level/itemwise_recommended_reorder_level.py 92.45% <0.00%> (-1.89%) ⬇️
... and 31 more

@ruchamahabal
Copy link
Member Author

@Mergifyio backport version-13-hotfix

@mergify
Copy link
Contributor

mergify bot commented Feb 11, 2022

backport version-13-hotfix

🟠 Waiting for conditions to match

  • merged [:pushpin: backport requirement]

@ruchamahabal ruchamahabal merged commit fe37103 into frappe:develop Feb 11, 2022
@ruchamahabal ruchamahabal deleted the leave-policy-assgn-fixes branch February 11, 2022 15:54
@mergify
Copy link
Contributor

mergify bot commented Feb 11, 2022

backport version-13-hotfix

✅ Backports have been created

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant