def Modifier(self, event): if len(self.Selection()) == 0: dlg = wx.MessageDialog( self, _(u"Vous n'avez sélectionné aucune prestation dans la liste" ), _(u"Erreur de saisie"), wx.OK | wx.ICON_EXCLAMATION) dlg.ShowModal() dlg.Destroy() return track = self.Selection()[0] if track.categorie == "cotisation": dlg = wx.MessageDialog( self, _(u"Pour modifier la prestation d'une cotisation, allez directement dans la liste des cotisations !" ), _(u"Information"), wx.OK | wx.ICON_EXCLAMATION) dlg.ShowModal() dlg.Destroy() return from Dlg import DLG_Saisie_prestation dlg = DLG_Saisie_prestation.Dialog(self, IDprestation=track.IDprestation, IDfamille=track.IDfamille) if dlg.ShowModal() == wx.ID_OK: self.MAJ(track.IDprestation) dlg.Destroy()
def Ajouter(self, event): from Dlg import DLG_Saisie_prestation dlg = DLG_Saisie_prestation.Dialog(self, IDprestation=None, IDfamille=self.IDfamille) if dlg.ShowModal() == wx.ID_OK: IDprestation = dlg.GetIDprestation() self.MAJ(IDprestation) dlg.Destroy()
def Modifier(self, event): if UTILS_Utilisateurs.VerificationDroitsUtilisateurActuel( "familles_prestations", "modifier") == False: return if len(self.Selection()) == 0: dlg = wx.MessageDialog( self, _(u"Vous n'avez sélectionné aucune prestation dans la liste" ), _(u"Erreur de saisie"), wx.OK | wx.ICON_EXCLAMATION) dlg.ShowModal() dlg.Destroy() return track = self.Selection()[0] if track.IDfacture != None: dlg = wx.MessageDialog( self, _(u"Cette prestation apparaît déjà sur la facture %s. Il est donc impossible de la modifier. \n\nSouhaitez-vous tout de même consulter le détail de cette prestation en mode lecture seule ?" ) % track.label_facture, _(u"Modification impossible"), wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_QUESTION) reponse = dlg.ShowModal() dlg.Destroy() if reponse != wx.ID_YES: return else: if self.gestion.Verification("prestations", track.date, silencieux=True) == False: dlg = wx.MessageDialog( self, _(u"Cette prestation est dans une période de gestion verrouillée. Il est donc impossible de la modifier. \n\nSouhaitez-vous tout de même consulter le détail de cette prestation en mode lecture seule ?" ), _(u"Modification impossible"), wx.YES_NO | wx.NO_DEFAULT | wx.CANCEL | wx.ICON_QUESTION) reponse = dlg.ShowModal() dlg.Destroy() if reponse != wx.ID_YES: return if track.categorie == "cotisation": dlg = wx.MessageDialog( self, _(u"Pour modifier la prestation d'une cotisation, allez directement dans la liste des cotisations !" ), _(u"Information"), wx.OK | wx.ICON_EXCLAMATION) dlg.ShowModal() dlg.Destroy() return from Dlg import DLG_Saisie_prestation dlg = DLG_Saisie_prestation.Dialog(self, IDprestation=track.IDprestation, IDfamille=track.IDfamille) if dlg.ShowModal() == wx.ID_OK: self.MAJ(track.IDprestation) dlg.Destroy()
def Ajouter(self, event): if UTILS_Utilisateurs.VerificationDroitsUtilisateurActuel( "familles_prestations", "creer") == False: return from Dlg import DLG_Saisie_prestation dlg = DLG_Saisie_prestation.Dialog(self, IDprestation=None, IDfamille=self.IDfamille) if dlg.ShowModal() == wx.ID_OK: IDprestation = dlg.GetIDprestation() self.MAJ(IDprestation) dlg.Destroy()