Closed vpp closed 6 years ago
Update Brian when it is fixed.
After investigating the issue with account of client who reported it, it appeared that they use the "unusual setup" - they do not use department allowances and solely rely on individual employees' allowance adjustments. Which in general reasonable enough.
However the application have some assumption when calculating available allowance during placing new timeoff request: it assumes that employee adjustments are valid only in current year.
I do not see any reasons why the adjustment does not affect future years.
So I am going to amend the logic for future years when calculating available allowance to take into consideration not only department's allowance but employe allowance adjustment as well.
Code that is responsible for that is here: https://github.com/timeoff-management/application/blob/master/lib/model/mixin/user/absence_aware.js#L449
Consider setup:
Company has two leave types
An employee X has one "Limited" holiday within this year.
Employee tries to add new request of either Limited or Unlimited type next year system shows an error of 'Requested absence is longer than remaining allowance' which is INCORRECT.