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

Can I use the  contract start date as condition in salary rules? To calculate the end of service of employee

So if the contract is less than 1 years this rules will appear?

The rule will be like


Today - contract.start_date > 1 year


Thanks

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

Hi,

Yes, you can use the contract start date as a condition in salary rules to calculate the end of service of an employee.You would typically achieve this using Python code within the salary rule.


time_difference = datetime.now() - contract.start_date

result = time_difference > relativedelta(years=1)


Hope it helps

อวตาร
ละทิ้ง

Thank you.

ผู้เขียน คำตอบที่ดีที่สุด

thanks dear,

it dose work,

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มิ.ย. 20
3790
0
มี.ค. 15
3975
0
พ.ค. 23
3797
1
ก.พ. 20
3973
1
มี.ค. 18
4612