I need to add total number of days of month (30 or 31) in a salary rule python code . How can i do that? result=-(contract.wage/30)*worked_days.Unpaid.number_of_days
You want to create a working schedule for each employee.
Human resource->Contract->working schedule
Then automatically get the total no.of days for each employee.
datej = str(payslip.date_to)
datek = str(payslip.date_from)
dj = datej[-2:]
new = 0
if str(x) == dj or "0"+str(x) == dj:
dk = datek[-2:]
old = 0
if str(y) == dk or "0"+str(y) == dk:
no_of_days = new-old + 1
result = no_of_days
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 7/3/13, 7:08 AM|
|Seen: 3421 times|
|Last updated: 3/16/15, 8:10 AM|