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


Hi every one,

i want compute allwance based on worked years in salary rules.

i will apply different % to contract.wage depending on number of worked years

eg :

{ 5% if worked years is between 2 and 5 years

15% if worked years is between 5 and 10 years

and so ...

}

I try Based Condition python :

result= (payslip.date_to - contract.date_start).days >= 735

where 735 = 2years in days



should i import datetime lib, casting difference days to integer ????

thanks for any help


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

I ve try :

Condition python :

result = payslip.date_to - contract.date_start > 735

But i cant make deduction on strings types.

Try import datetime library to cast those dates fields but no way.

Any idea?

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ม.ค. 20
2847
0
ธ.ค. 17
3183
2
ต.ค. 17
5884
2
ธ.ค. 24
11724
2
ธ.ค. 22
7942