Hi I am currently stuck in an issue . I am trying to define a salary rule which will calculate the salary of employee on the base of date_to and date_from But in these object. I am only able get days. By using days i can get worked days from them. I am unable to get month year there.
datej = str(payslip.date_to)
datek = str(payslip.date_from)
dj = datej[-2:]
dk = datek[-2:]
working_days=dj-dk
one_daySalary=contract.wage/30
salary=working_days*one_daySalary
result = salary
I am only able to calculate the salary on bases of fixed 30 days month. If you have better idea about that then please help me. Thanks for your time.