Hi, i’m new at this but i’ve been given a task to calculate salary for the starting month of an employee. The problem is, the employee might not start at the beginning of the month so i must calculate the salary from the startdate of his/her work til the enddate of the month.
I’ve got a startdate field (user input) , enddate , proposed salary (user input) , totalsalary, base(the total days in a month), and workdays(total days of employee’s working days)
The problem is, i don’t know how to extract the month from the startdate field so that i can adjust the enddate to become the end of the “startdate” month. N as i’m new at this, i’m not sure which is more suitable, using the @formula language or the Lotusscript.
N lets say i have the month of the startdate already, how am i supposed calculate total number of businessdays of the “startdate” month? so far i’ve only done this :-
xx=Evaluate({@BusinessDays(Istartdate; enddate; 1:7)}, doc)
doc.workdays=xx
but the enddate field’s formula is computed using this month’s enddate so it’s
mth :=@Month(@Now)+1;
@Adjust ( @Date( year ; mth ; 1); 0 ; 0 ; -1 ; 0 ; 0 ; 0)
The question is, what if i’m calculating a salary of an employee who started last month? The computer will calculate the whole of this month and last month so it’ll return a wrong answer. Any tips or suggestions would be very much appreciated. Thanks in advance.