Skip to Content
मेन्यू
This question has been flagged

Hello, I am getting an error while computing the sheet for payslip
Can somebody please help me out with what I am doing wrong.

User Error

Wrong python condition defined for:: - 

Salary rule: Expenses Reimbursement (EX) 

- Error: : "0" 

while evaluating "result = inputs['EX'].amount > 0.0 if 'EX' in inputs else False\n"

Rule name - Expense Reimbursement
category - Allowance

code - EX

Python condition - 

result = inputs['EX'].amount > 0.0 if 'EX' in inputs else False


python code for computation - 

result = inputs['EX'].amount if 'EX' in inputs else 0


Avatar
Discard
Best Answer

Hi

Hope everything well

you can write python condition like below

if 'EX' in inputs:

​return 1

else:

​return 0

Avatar
Discard
Author

Hi, thanks for answering.
Now i am getting this error after trying your condition
Please help

User Error

Wrong python condition defined for::
- Salary rule: Expenses Reimbursement (EX)
- Error: invalid non-printable character U+200B (, line 3)

Please post screen shot of rules and you can try below code as well
1 select value in field Condition Based on field - Python Expression and then add this below code in field python condition
result = 'EX' in inputs

Related Posts Replies Views Activity
0
जन॰ 17
3700
3
जुल॰ 19
6125
0
मार्च 22
2627
0
जून 17
3312
1
फ़र॰ 24
2357