i don't know how to carry forward the result?
for example, for the first 2 years, he does not has bonus leave, on the third year onwards, he has 1 day increase.
by default, he has 18 days leave, on the third year, he can carry forward the maximum 10 days(not 18 days) from the previous year, now, he has 28 days leave plus 1 day bonus leave = 29 days.
same with the fourth year, he can carry forward maximum 10 days, so, he has 39 days leave plus 1 day bonus leave = 40 days.
if he apply 2 days leave in the first 2 years, the balance is 16 days. on the third year, he only can carry forward 10 days only, not 16 days.
if he apply 12 days leave in the first 2 years, the balance is 6 days. on the third year, he only can carry forward 6 days only, not 10 days.
this is the problem that i don't know how to fix, can you teach me?
can someone give suggestion how to use this in mysql database to carry forward from the previous year & add to next year? thanx.