Skip to Content
Menu
This question has been flagged

Hello,

I'm facing an issue in calculating the employee salary. It's that the no. of working days has fraction

At the beginning, allow me to start with expressing my current setup for payroll and contracts

-each employee has a contract with working schedule of:

    from Saturday to Wednesday as full time

    Thursday is half day

    Friday off     

-each employee has an unpaid leave salary rule in his salary structure.

     the unpaid leave is to deduct the approved leave request from employee.

     the formula to calculate unpaid leave is 

#Python Code
result = -12 * (categories.BASIC + categories.ALW)*(worked_days.Unpaid.number_of_days or 0)/(6*52)

The problem is when you go to payroll module to generate an employee payslip, in Working days & inputs tab I get the number of days @WORK100 is 27.75 for Jan 2017

and number of days @Unpaid is 1.13

but in reality it should be only 27 days @WORK100, as in January 2017 we have:

total days/month: 31

No. of occurred Fridays: 4 days

total worked days @WORK100 should be: 31-4=27 


Why Odoo is calculating the no. of days with fraction? .. In what basis Odoo calculates the working days?

This is also impacting on the unpaid leave calculation which is based on the no. of  days


 Is something wrong in my current setup? Do I miss something?

Can someone please help me with this setup

Thanks

Avatar
Discard
Best Answer

Please tell me what module you use for work day, and I can solve it


Avatar
Discard
Related Posts Replies Views Activity
1
Mar 24
2460
2
Jul 25
3698
1
Jul 25
2886
0
Dec 24
1590
0
Dec 23
1445