Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
2307 Vistas

I want to calculate a payslip basis on the worked days & the hourly wage.


I've tried this command 

'result = contract.x_studio_transport_allowance * (contract.ressource_calendar_id/contract.full_time_required_hours)


But i've this message 

Code python incorrect défini pour la règle de salaire Prime de transport (ITRP). Erreur : : "'hr.contract' object has no attribute 'ressource_calendar_id'" while evaluating 'result = contract.x_studio_transport_allowance * (contract.ressource_calendar_id/contract.full_time_required_hours)\n'

Avatar
Descartar
Autor Mejor respuesta

The error message indicates that the 'hr.contract' object doesn't have an attribute named 'ressource_calendar_id'. In the formula you are trying to divide the 'ressource_calendar_id' by the 'full_time_required_hours'. If you want to calculate the number of worked days, you need to access the 'resource_calendar_id' instead of 'ressource_calendar_id' and divide it by the number of required hours.

Here is the corrected formula:

result = contract.x_studio_transport_allowance * (contract.resource_calendar_id/contract.full_time_required_hours)

Note that this formula only gives you the amount of transport allowance for a single day. To calculate the total transport allowance for the entire payslip period, you will need to multiply this amount by the number of worked days during that period.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
dic 23
1200
0
dic 22
1734
1
dic 18
3833
2
nov 18
6233
2
mar 15
9086