Ir al contenido
Menú
Se marcó esta pregunta

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
Descartar
Mejor respuesta

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


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
mar 24
2445
2
jul 25
3676
1
jul 25
2866
0
dic 24
1572
0
dic 23
1419