Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
6341 มุมมอง

Hi, 

I am trying to calculate an Allowance item in the salary slip. The contract has a custom field called x_ctc_mo (contract.x_ctc_mo)

The rule requires the medical allowance, basic salary, food allowance, and other categories to be deducted from contract.x_ctc_mo 

I tried 

result = contract.x_ctc_mo - rules.BASIC - rules.MEDA .... and so on.


However, the result shows the value of contract.x_ctc_mo - rules.BASIC only for some reasons other categories are not calculated at all. 

What am doing wrong?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try :

result = contract.x_ctc_mo - BASIC - MEDA

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Just make a try in this,

result = contract.x_ctc_mo - BASIC - MEDA .... and so on.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

I managed to :-). Not sure if that was the best way available but my requirement needed to calculate the salary remainder after the deductions and allowances. So all I had to do was i used contract.x_ctc_mo - categories.BASIC - categories.ALW

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Did you manage to solve it?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ค. 25
3851
1
ก.ค. 25
2999
0
ธ.ค. 24
1699
0
ธ.ค. 23
1529
0
ก.ย. 20
1557