Sfoglia il codice sorgente

FIX corrige type données vehiculeperso

olivier.massot 7 anni fa
parent
commit
65decd7a4a
1 ha cambiato i file con 6 aggiunte e 6 eliminazioni
  1. 6 6
      agrhum_traitement.py

+ 6 - 6
agrhum_traitement.py

@@ -111,9 +111,9 @@ def main(CodeAgent, MoisRH, AnneeRH, auto=False):
             fraisdep.Depart = el.Depart
             # mettre a jour le codedepart
             fraisdep.Itineraire = " - ".join([loc for loc in (fraisdep.Depart, el.Localisation) if loc])
-            fraisdep.Distance1_perso = int(el.DistanceTranche1) if el.VehiculePersoTranche1 == "True" else 0
-            fraisdep.Distance2_perso = int(el.DistanceTranche2) if el.VehiculePersoTranche2 == "True" else 0
-            fraisdep.Distance2_service = int(el.DistanceTranche2) if not el.VehiculePersoTranche2 == "True" else 0
+            fraisdep.Distance1_perso = int(el.DistanceTranche1) if el.VehiculePersoTranche1 else 0
+            fraisdep.Distance2_perso = int(el.DistanceTranche2) if el.VehiculePersoTranche2 else 0
+            fraisdep.Distance2_service = int(el.DistanceTranche2) if not el.VehiculePersoTranche2 else 0
             fraisdep.Repas = int(el.Repas)
 
             # Indexation des objets par jour
@@ -123,9 +123,9 @@ def main(CodeAgent, MoisRH, AnneeRH, auto=False):
         else :
             # Mise à jour d'un objet existant
             index_dep[el.DateRH.day].Itineraire += " - {}".format(el.Localisation)
-            index_dep[el.DateRH.day].Distance1_perso += int(el.DistanceTranche1) if el.VehiculePersoTranche1 == "True" else 0
-            index_dep[el.DateRH.day].Distance2_perso += int(el.DistanceTranche2) if el.VehiculePersoTranche2 == "True" else 0
-            index_dep[el.DateRH.day].Distance2_service += int(el.DistanceTranche2) if not el.VehiculePersoTranche2 == "True" else 0
+            index_dep[el.DateRH.day].Distance1_perso += int(el.DistanceTranche1) if el.VehiculePersoTranche1 else 0
+            index_dep[el.DateRH.day].Distance2_perso += int(el.DistanceTranche2) if el.VehiculePersoTranche2 else 0
+            index_dep[el.DateRH.day].Distance2_service += int(el.DistanceTranche2) if not el.VehiculePersoTranche2 else 0
             index_dep[el.DateRH.day].Repas += int(el.Repas)