跳至內容
選單
此問題已被標幟
1 回覆
2648 瀏覽次數

hi,

Hello everyone, I want to ask, in the picture below I made an overtime calculation on the payslip based on the period that has been entered in the work entry, but the number of hours cannot be called on the payslip, is there something wrong with the python code? Please help. thank you


頭像
捨棄
最佳答案

Hi,

Try this code:overtime = 0
for line in employee.overtime_ids:
if payslip.date_from overtime+= line.duration
result = (contract.wage/30/contract.resource_calendar_id.hours_per_day)*(overtime)

This code aggregates the overtime duration for each relevant line within the specified payslip period and then calculates the corresponding overtime payment based on the hourly rate determined by the contract.


Hope it helps

頭像
捨棄
作者

thanks for you answer

相關帖文 回覆 瀏覽次數 活動
2
7月 25
3895
1
7月 25
3023
0
12月 24
1729
0
12月 23
1541
0
9月 20
1557