Skip to Content
Menu
This question has been flagged
2764 Views

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)
Avatar
Discard

Gracias bro!! me fue de gran ayuda tu aporte.

Related Posts Replies Views Activity
1
Dec 24
397
0
Nov 24
107
1
Jul 24
4042
2
Jun 24
3469
1
Dec 23
449