daxguy Posted July 13, 2011 Share Posted July 13, 2011 i wanted a way to work out a small task i am into.. i have developed a salary program which manages the salary of employees in my organisation.. the salary program is working all good.. but now i am stuck in a situation.. the salary program works as follows : -the employee is selected during the month if the employee takes any advance his amount on the that specific date is added to the db -an employee can take advance salary before the 30th of the month on his need which is added to the db - i have a created a script that shows all the advances of the employee selected during the month and subtracts the advances from the basic pay and shows the result.. eg : employee david basic salary 5000$.. total advance 2750$ remaing sal basic-advance Now the problem i am in is that some times the advance increase from the basic pay.. which is allowed in certain situation.. than the remaining amount is in minus like advance 6000 and basic pay is 4000 soo -2000 is remaing.. i want the negative amount to automatically be forwarded in the next month advance on every 30th of the month.. soo that i can manage the advance salaries properly.. does any one have a good suggestion? Quote Link to comment https://forums.phpfreaks.com/topic/241870-a-simple-salary-program/ Share on other sites More sharing options...
cunoodle2 Posted July 13, 2011 Share Posted July 13, 2011 Can you have an "overall standing" column in your table? Basically a running total that tracks where everything stands. "0" means that the company and employee are even. -200 means that the employee "owes" the company $200. If overall_standing < 0 { Amount of pay is monthly_pay - overall_standing; Overall_standing = 0; } That work??? Quote Link to comment https://forums.phpfreaks.com/topic/241870-a-simple-salary-program/#findComment-1242107 Share on other sites More sharing options...
daxguy Posted July 13, 2011 Author Share Posted July 13, 2011 well a nice suggestion the over standing will help me getting my status wheather the employee owes the organisation or not.. the condition u mentioned is all fine as well.. but i want the status to be updated on the end of the month beacause the salaries are issued at the end of the month... plus i want to transfer the remainging amount if negative to the next month status which will than 1st get minus from the basic pay!! Quote Link to comment https://forums.phpfreaks.com/topic/241870-a-simple-salary-program/#findComment-1242109 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.