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(UX): enable Track Changes, show allocation history for earned leaves allocated via scheduler #30613

Merged
merged 3 commits into from
Apr 7, 2022

Conversation

ruchamahabal
Copy link
Member

@ruchamahabal ruchamahabal commented Apr 6, 2022

Background:

If Leave Policy Assignment is created for Earned Leave, initially 0 leaves are allocated and then allocation happens every month based on the configuration set in Leave Type.
eg Policy: Annual Allocation: 24, Frequency: Monthly
In this case, 2 leaves will be allocated every month for the employee via scheduler.

Problem:

  • Users are directly shown Total Leaves Allocated in Leave Allocation.
    image

  • There is no trace of when the scheduler allocates these leaves because this happens via db_set

  • "New Leaves Allocated" field is editable after submission even for Earned Leave type with policy assignment which doesn't make sense because this allocation happens via scheduler. Users can reset leaves to 0 directly, without any trace and ledgers do not handle this.

  • There is one more setting that decides when this leave will be allocated via the scheduler in Leave Type master. If Based on Date of Joining is enabled, it allocates leave every month on the Joining Date of the employee, else on month-end.

    image
  • Basically, users have to see 3 different things and do the mental math to derive the number of leaves shown in the allocation: the annual allocation, the number of months that have passed, and the based on DOJ setting.

Fix:

  • Enable Track Changes for Leave Allocation (useful for allocations not happening via a scheduler)
  • Make New Leaves Allocated input read-only if the earned leave Allocation is linked to Leave Policy Assignment (indicating that this will happen via scheduler)
  • Show the history of earned leaves allocated along with the date and the info of whether they were allocated based on DOJ or not

Based on DOJ:

log

Usual:

image

@github-actions github-actions bot added HR needs-tests This PR needs automated unit-tests. labels Apr 6, 2022
@ruchamahabal ruchamahabal removed the needs-tests This PR needs automated unit-tests. label Apr 6, 2022
@ruchamahabal
Copy link
Member Author

ruchamahabal commented Apr 7, 2022

Not adding tests since it's just a comment being added to the doc timeline. Earned leave calculation already has coverage. Unrelated test failures

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant