Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2393 Widoki

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'

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
gru 23
1269
0
gru 22
1809
1
gru 18
3909
2
lis 18
6302
2
mar 15
9232