Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

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


Awatar
Odrzuć
Najlepsza odpowiedź

Hi

Hope everything well

you can write python condition like below

if 'EX' in inputs:

​return 1

else:

​return 0

Awatar
Odrzuć
Autor

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

Powiązane posty Odpowiedzi Widoki Czynność
0
sty 17
3691
3
lip 19
6105
0
mar 22
2621
0
cze 17
3288
1
lut 24
2341