Browse Source

NEW ctrl2analytique - Mise à jour de strCreateur dans tbl_Tarification

olivier.massot 7 years ago
parent
commit
117b0002b3
2 changed files with 5 additions and 3 deletions
  1. 1 0
      core/pde.py
  2. 4 3
      ctrl2analytique.py

+ 1 - 0
core/pde.py

@@ -188,6 +188,7 @@ class Tarification(Model):
         self.dblPrixTVA = 0, float
         self.strStatut = None, str
         self.strNumFacture = None, str
+        self.strCreateur = "", str
 
 
 class FactureGf(Model):

+ 4 - 3
ctrl2analytique.py

@@ -441,7 +441,7 @@ def main():
         if not interv.dtmDureeIntervention or interv.dtmDureeIntervention == date_zero:
             errors.append(prefix + "Durée d'intervention nulle")
 
-    # *** 6- Interruption pour corection manuelle des données (si nécessaire)
+    # *** 6- Interruption si erreurs
     if errors:
         logging.error("<!> Des erreurs ont été détectées dans les données à importer. <!>")
         for msg in errors:
@@ -541,12 +541,13 @@ def main():
         tarif.dblTauxTVA = taux_tva
         tarif.dblPrixTVA = tarif.dblPrixTotal * (0.01 * tarif.dblTauxTVA)
         tarif.strStatut = 'A facturer'
+        tarif.strCreateur = 'scriptauto'
 
         sql = Sql.format(""" INSERT INTO tbl_Tarification ( DblAffaireId, strRapportId, strArticleId, dblQuantite, strUnite, dtmDebut, dtmFin, bytPeriode,
-                                                 dblPrixUnitaire, dblPrixTotal, dblTauxTVA, dblPrixTVA, strStatut )
+                                                 dblPrixUnitaire, dblPrixTotal, dblTauxTVA, dblPrixTVA, strStatut, strCreateur )
                   VALUES ({tarif.DblAffaireId}, {tarif.strRapportId:text}, {tarif.strArticleId:text}, {tarif.dblQuantite}, {tarif.strUnite:text}, {tarif.dtmDebut:date},
                            {tarif.dtmFin:date}, {tarif.bytPeriode}, {tarif.dblPrixUnitaire}, {tarif.dblPrixTotal},
-                           {tarif.dblTauxTVA}, {tarif.dblPrixTVA}, {tarif.strStatut:text})
+                           {tarif.dblTauxTVA}, {tarif.dblPrixTVA}, {tarif.strStatut:text}, {tarif.strCreateur:text})
                 """, tarif=tarif)
         analytique_db.execute(sql)