Skip to Content
Menu
This question has been flagged
1 Reply
2333 Views

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
Discard
Author Best Answer

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
Discard
Related Posts Replies Views Activity
0
Dec 23
1215
0
Dec 22
1760
1
Dec 18
3841
2
Nov 18
6253
2
Mar 15
9120