Skip to Content
Menu
This question has been flagged
2 Replies
3609 Views

 Just like regular attendance has a code (WORK100) I created another work entry for extra hours (HED100)


I am trying to create a salary rule that checks if the number of credit hours is greater than 0 (HED100 > 0)


If that condition is met, then compute the calculation I defined in the the calculation part


This is how I defined that salary rule:


Condition: python expression


Result = inputs.HED100.amount > 0 


IF this condition is true then compute the following calculation


Result = Python formula:


result = (contract.hourly_wage) * (worked_days.HED100.number_of_hours) * (1.25)



When I set the condition to be “always true” this salary rule works fine until I have zero extra hours in the payslip. Therefore, the problem must be in my condition


Unfortunately, I don’t know how to work with these python variables. 


Maybe inputs is not the right variable


I will attach as a comment the URL with a screenshot of the salary rule


Thank you for your time! 

Avatar
Discard
Best Answer

try to use # payslip: object containing the payslips

if you have created HED100 in payslip not in inputs!!
 

Avatar
Discard
Author Best Answer

Here is the URL https://imgur.com/ceGyQGd

Avatar
Discard