Hello, I've struggling on how to make this work, I want something like
if code.Unpaid == true
calculate this x this
elif code.SickAbsences == true
calculate this x this
I want to be able to tell the system if my payslip contains a code named "Impagada" then trigger that condition and do that calculation.
When I try something like this, I have an error
this is my current code
My type of abscences are on spanish due to translations but these are
Impagada
AusenciasLegales2017
AusenciasPorEnfermedad
DiasCompensatorios
if worked_days.WORK100.number_of_hours >= 42:
result = 0 elif worked_days.WORK100.number_of_hours < 42:
if worked_days.Impagada.number_of_days > 0:
result = -worked_days.Impagada.number_of_days * (contract.wage / 7)
elif worked_days.AusenciasLegales2017.number_of_days > 0:
result = -worked_days.Impagada.number_of_days * (contract.wage / 7)
elif worked_days.DíasCompensatorios.number_of_days > 0:
result = -worked_days.Impagada.number_of_days * (contract.wage / 7)
elif worked_days.AusenciasPorEnfermedad.number_of_days > 0:
result = -worked_days.Impagada.number_of_days * (contract.wage / 7)
Gracias bro!! me fue de gran ayuda tu aporte.