leave calculation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
irvine
Forum Newbie
Posts: 14
Joined: Sat Jul 26, 2003 3:04 am

leave calculation

Post by irvine »

hi,

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 10 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 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 u don't know how to fix, can you teach me?

thank you.....
Tubbietoeter
Forum Contributor
Posts: 149
Joined: Fri Mar 14, 2003 2:41 am
Location: Germany

Post by Tubbietoeter »

not without sourcecode
Post Reply