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

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?

頭像
捨棄
最佳答案

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?

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
7月 25
3682
1
7月 25
2875
0
12月 24
1580
0
12月 23
1425
0
9月 20
1557