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

Grant Leave via Leave Policy Assignment is not calculating earned leaves - v13 #108

Closed
harishalwar9 opened this issue Feb 23, 2021 · 8 comments
Assignees
Labels
bug Something isn't working to-validate

Comments

@harishalwar9
Copy link

Grant leaves is not allocating earned leaves prorated

v13.x.x-develop (docker image) hosted in our server and v12.16.2 (locally)

Output of bench version of localhost

erpnext 12.16.2
frappe 12.13.0

Output of bench version of docker image

erpnext v13.x.x-develop () (develop)
frappe  v13.x.x-develop () (develop)

Steps to reproduce the issue (docker image)

  1. Set any leave type as earned leave. I set Privilege leaves as 1.5 leaves / month, Sick leaves 0.5 / month, Casual leaves 0.5 / month
  2. Set Leave Period as 01-01-2021 to 31-12-2021 (this year), set leave policy for all leave types
  3. Search for Leave Policy Assignment in awesome bar, submit Leave policy assignment for the leave period and leave policy and click Grant Leaves button. Today is Feb month but shows no accrued / earned leaves for Jan month.

Showed 0 leaves in balance

1.5 leaves of PL, 0.5 SL and 0.5 CL for Jan 2021 month

Stacktrace / full error message

(paste here)

Additional information

OS version / distribution, ERPNext install method - docker image (version mentioned above)
Attached is the screenshots of leave allocated via Grant button in Leave Policy Assignment page. Screenshot shows previous carry forward leaves too but issue is with earned leaves not being accrued every month. Kindly advise.
leave-5-sec

Tried v12 running locally as well but even in that Grant leaves is not working. Below is screenshot for reference
ERPNext-v12-Leave

@harishalwar9 harishalwar9 added the bug Something isn't working label Feb 23, 2021
@harishalwar9
Copy link
Author

Manually allocated leaves (via leave allocation) is calculating pro-rated leaves after 2 months. However Grant Leaves is still not doing so. Kindly advise

@pateljannat
Copy link
Contributor

@harishalwar9 can you share the screenshot of the Leave Policy Assignment as well

@harishalwar9
Copy link
Author

Thanks @pateljannat Attached is the screenshot of leave assignment
image

@pateljannat
Copy link
Contributor

@harishalwar9 I am unable to replicate the issue on version 13. Sharing the steps that I followed. Let me know if I did something different.

  1. Created Leave Period for the Financial year 2020-2021

Screenshot 2021-03-31 at 5 40 43 PM

  1. Created Leave Policy

Screenshot 2021-03-31 at 5 53 16 PM

  1. Carry Forward Leave type.

Screenshot 2021-03-31 at 6 01 04 PM

  1. Leave allocation for the financial year 2020-2021.

Screenshot 2021-03-31 at 5 48 28 PM

  1. Leave period for the financial year 2021-2022

Screenshot 2021-03-31 at 5 41 34 PM

  1. Leave allocation for the financial year 2021-2022

Screenshot 2021-03-31 at 5 50 02 PM

Note unused leaves from the previous allocation which was 4 is reflecting here, which makes the total leaves 8

  1. Leave policy assignment

Screenshot 2021-03-31 at 5 57 43 PM

  1. Allocated leave shown in the Leave application.

Screenshot 2021-03-31 at 5 48 01 PM

Note: Available Earned Leaves showing as 8 which is the same as Total Leave from the Leave allocation of the financial year 2021-2022

@harishalwar9
Copy link
Author

harishalwar9 commented Apr 8, 2021

@pateljannat Steps carried out is fine, I am talking about prorated leave allocation which should happen every month automatically based on leave type for the leave period. If you look at my example, the leave period is from 01-01-2021 till 31-12-2021 with 1.5 Leaves per month for Privilege leave type. So by end of March 2021, it should have automatically allocated 4.5 leaves (1.5 for 3 months) however it is not doing. So I have to either manually allocate every month or allocate for the entire year upfront. The check box "earned leave", what I understand, is supposed to calculate every month for the given leave period. Excerpt from ERP documentation about Earned Leave -

2.2 Earned Leave
Earned Leaves are leaves earned by an Employee after working with the company for a certain amount of time. Checking "Is Earned Leave" will allot leaves pro-rata basis by automatically updating Leave Allocation for leaves of this type at intervals set by 'Earned Leave Frequency'.

For example, an Employee is allotted 24 Privilege Leaves in a year, wherein the Privilege Leave is set as Earned Leave with Monthly allotment. In this case, the Employee will earn 2 (24 leaves/12 months) Privilege Leaves at the end of every month. The leave allotment process (background job) will only allot leaves considering the max leaves for the leave type and will round to 'Rounding' for fractions.

@pateljannat
Copy link
Contributor

@harishalwar9 I think this PR will solve the issue
frappe/erpnext#25334

@onlinebizsoft
Copy link

@harishalwar9 can you confirm if the issue solved?

@harishalwar9
Copy link
Author

@harishalwar9 can you confirm if the issue solved?

I using a docker image. For me to take the PR, I have to migrate from docker and install the source code and then take the pull. I have not tried this yet.

@deepeshgarg007 deepeshgarg007 transferred this issue from frappe/erpnext Oct 26, 2022
zilurrane pushed a commit to zilurrane/hrms that referenced this issue Oct 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working to-validate
Projects
None yet
Development

No branches or pull requests

5 participants