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

what I want : if an employee is a Male then his deduction tax will be 600

and  if an employee is a Female then his deduction tax will be 400

I tried in Payroll >> Salary Rules >> deduction tax

by using this code in 

Computation: 

if (hr.employee.gender== "male"):
 result = ((categories.BASIC + categories.ALW) -500)

else if (hr.employee.merital== "married"):
 result =((categories.BASIC + categories.ALW) -400)
I didn't get computation, I dont know how to fix it 

can anybody please help me.


Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

Try this

if (employee.gender == 'male'):
     result = ((categories.BASIC + categories.ALW) -500)
elif (employee.marital == 'married'):
     result = ((categories.BASIC + categories.ALW) -400)


The " else if " will checks if the employee not a male and if is married (not male and married) [I just wrote it as yours]

Hope it'll work

Awatar
Odrzuć
Autor Najlepsza odpowiedź

sorry for reply here because of my carma.

Thank you for your reply.....
I tried by your code but... it shows me Error: 

Wrong python code defined for salary rule Federal Tax (FT).

Awatar
Odrzuć

Hi, I just copy&paste the code below and it works with me ... can you paste your code , maybe you missed something ...

Autor

it works ... thx a lot

Powiązane posty Odpowiedzi Widoki Czynność
0
kwi 24
1883
4
lis 23
6005
0
paź 23
1756
0
gru 22
2644
2
gru 23
19368