diff --git a/database.py b/database.py index abc42657..60478934 100644 --- a/database.py +++ b/database.py @@ -32,7 +32,7 @@ import bcrypt from config import config -DB_VERSION = 130 +DB_VERSION = 131 Base = declarative_base() @@ -244,6 +244,8 @@ class Creche(Base): tri_factures = Column(Integer, default=TRI_NOM) smtp_server = Column(String) caf_email = Column(String) + numero_caf = Column(String) + numero_dossier_afc = Column(String) mode_accueil_defaut = Column(Integer, default=MODE_TEMPS_PARTIEL) gestion_absences_non_prevenues = Column(Boolean, default=False) gestion_maladie_sans_justificatif = Column(Boolean, default=False) @@ -3176,6 +3178,10 @@ def translate(self): if version < 130: self.engine.execute("ALTER TABLE creche ADD email_changements_planning STRING") + if version < 131: + self.engine.execute("ALTER TABLE creche ADD numero_caf VARCHAR") + self.engine.execute("ALTER TABLE creche ADD numero_dossier_afc VARCHAR") + # update database version version_entry.value = DB_VERSION self.commit() diff --git a/generation/export_filoue.py b/generation/export_filoue.py index 6a3c0629..322dcf50 100644 --- a/generation/export_filoue.py +++ b/generation/export_filoue.py @@ -51,6 +51,10 @@ def execute(self, text): result = [lines[0]] template = lines[1] for inscrit in database.creche.select_inscrits(self.start, self.end): + if not inscrit.famille.numero_allocataire_caf: + errors[GetPrenomNom(inscrit)] = [u"Le numéro d'allocataire CAF n'est pas renseigné"] + elif not inscrit.famille.numero_allocataire_caf.isdigit(): + errors[GetPrenomNom(inscrit)] = [u"Le numéro d'allocataire CAF ne doit comporter que des chiffres"] regime_caf = 3 heures_realisees = 0 heures_facturees = 0 @@ -74,6 +78,8 @@ def execute(self, text): line = template if facture: fields = { + "numero-caf": database.creche.numero_caf, + "numero-dossier-afc": database.creche.numero_dossier_afc, "top-allocataire": 1, "prenom": inscrit.prenom, "nom": inscrit.nom, @@ -86,7 +92,7 @@ def execute(self, text): "heures-realisees": "%04.02f" % heures_realisees, "total-facture": "%06.02f" % total_facture, "tarif-horaire": "%02.02f" % ((total_facture / heures_facturees) if heures_facturees else 0), - "taux-effort": ("%01.02f" % facture.taux_effort) if facture.taux_effort else None, + "taux-effort": ("%01.03f" % facture.taux_effort) if facture.taux_effort else None, "premier-jour": max(self.start, min([contrat.debut for contrat in inscrit.get_inscriptions() if contrat.debut and not contrat.preinscription])).strftime("%d/%m/%Y"), "dernier-jour": min(self.end, max([(contrat.GetFin() if contrat.GetFin() else self.end) for contrat in inscrit.get_inscriptions() if contrat.debut and not contrat.preinscription])).strftime("%d/%m/%Y"), } diff --git a/panel_configuration.py b/panel_configuration.py index 85b9ba4f..a03a6a5e 100644 --- a/panel_configuration.py +++ b/panel_configuration.py @@ -133,6 +133,8 @@ def __init__(self, parent): grid_sizer.AddMany([wx.StaticText(self, -1, "E-mail :"), (AutoTextCtrl(self, database.creche, "email"), 0, wx.EXPAND)]) grid_sizer.AddMany([wx.StaticText(self, -1, "Serveur pour l'envoi d'emails :"), (AutoTextCtrl(self, database.creche, "smtp_server"), 0, wx.EXPAND)]) grid_sizer.AddMany([wx.StaticText(self, -1, "Email de la CAF :"), (AutoTextCtrl(self, database.creche, "caf_email"), 0, wx.EXPAND)]) + grid_sizer.AddMany([wx.StaticText(self, -1, "Numéro CAF :"), (AutoTextCtrl(self, database.creche, "numero_caf"), 0, wx.EXPAND)]) + grid_sizer.AddMany([wx.StaticText(self, -1, "Numéro dossier Sias AFC :"), (AutoTextCtrl(self, database.creche, "numero_dossier_afc"), 0, wx.EXPAND)]) type_structure_choice = AutoChoiceCtrl(self, database.creche, "type", items=TypesCreche) self.Bind(wx.EVT_CHOICE, self.OnChangementTypeStructure, type_structure_choice) grid_sizer.AddMany([wx.StaticText(self, -1, "Type :"), (type_structure_choice, 0, wx.EXPAND)]) diff --git a/templates_dist/Export Filoue.csv b/templates_dist/Export Filoue.csv index be6208ee..3e389cf1 100755 --- a/templates_dist/Export Filoue.csv +++ b/templates_dist/Export Filoue.csv @@ -1,2 +1,2 @@ -TOP_ALLOC;MATRICULE;REGIME;DATE_NAISSANCE_INDIVIDU;CODE_POSTAL_FAMILLE;VILLE_FAMILLE;NOMBRE_HEURES_FACTUREES;NOMBRE_HEURES_REALISEES;MONTANT_FACTURE;MONTANT_HORAIRE;TAUX_EFFORT;PREMIERJOUR;DERNIERJOUR -;;;;;;;;;;;; +NUMERO_CAF;NUMERO_DOSSIER_AFC;TOP_ALLOC;MATRICULE;REGIME;DATE_NAISSANCE_INDIVIDU;CODE_POSTAL_FAMILLE;VILLE_FAMILLE;NOMBRE_HEURES_FACTUREES;NOMBRE_HEURES_REALISEES;MONTANT_FACTURE;MONTANT_HORAIRE;TAUX_EFFORT;PREMIERJOUR;DERNIERJOUR +;;;;;;;;;;;;;; diff --git a/version.py b/version.py index a064feea..214d5759 100755 --- a/version.py +++ b/version.py @@ -15,4 +15,4 @@ # You should have received a copy of the GNU General Public License # along with Gertrude; if not, see . -VERSION = '1.22.36' +VERSION = '1.22.37'