Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2400 Tampilan

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
Buang
Penulis Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Des 23
1276
0
Des 22
1822
1
Des 18
3914
2
Nov 18
6309
2
Mar 15
9242