I am developing HR system, I want to calculate how many days off the employee can take.
In the HR table I have three attributes
1- start_date(when the employee starting to work in the company).
2- leavestaken(how many days off the employee took before).
3- leaves(the number of days available for the employee to take off) which equal to=(months between current date and start_date) * 2.5(beacuse each month give 2.5 days off) - leavestaken
third attribute is automated and not from the user, how I can get the first and second attributive values from field forms, use them in the calculation and save the result in the leaves attribute?