i don't know how to carry forward the result?
for example, for the first 2 years, a new staff does not has bonus leave, on the third year onwards, he has 1 day increase.
by default, he has 18 days leave, the maximum days he can bring to next year are 10 days. If he already applied 12 days, than he can carry forward 6 days to the next year.
i explain more by giving this example
Start working at 2000
(default) 18
(apply leave) -15
3 days
(bring forward to 2001) 3 days
2001
(default) 18
(apply leave) -13
5 days
(carried forward from 2000) 3 days
8 days
(bring forward to 2002) 8 days
2002
(default) 18
(apply leave) -11
7 days
(carried forward from 2001) 8 days
15 days
(bring forward to 2003) maximum 10 days
2003
(default) 18
(bonus leave after 1 year) +1
(apply leave) -14
5 days
(carried forward from 2002) 10 days
15 days
(bring forward to 2004) maximum 10 days