def OnBoutonAjouter(self, event):
        """ Créer une facture """
        if UTILS_Utilisateurs.VerificationDroitsUtilisateurActuel(
                "familles_factures", "creer") == False:
            return

        from Dlg import DLG_Verification_ventilation
        tracks = DLG_Verification_ventilation.Verification(
            self.IDcompte_payeur)
        if len(tracks) > 0:
            dlg = wx.MessageDialog(
                self,
                _(u"Un ou plusieurs règlements peuvent être ventilés.\n\nSouhaitez-vous le faire maintenant (conseillé) ?"
                  ), _(u"Ventilation"),
                wx.YES_NO | wx.YES_DEFAULT | wx.CANCEL | wx.ICON_EXCLAMATION)
            reponse = dlg.ShowModal()
            dlg.Destroy()
            if reponse == wx.ID_YES:
                dlg = DLG_Verification_ventilation.Dialog(
                    self, tracks=tracks,
                    IDcompte_payeur=self.IDcompte_payeur)  #, tracks=tracks)
                dlg.ShowModal()
                dlg.Destroy()
            if reponse == wx.ID_CANCEL:
                return False

        from Dlg import DLG_Factures_generation
        dlg = DLG_Factures_generation.Dialog(self)
        dlg.SetFamille(self.IDfamille)
        dlg.ShowModal()
        dlg.Destroy()
        self.ctrl_listview.MAJ()
Beispiel #2
0
 def VerifierVentilation(self):
     from Dlg import DLG_Verification_ventilation
     tracks = DLG_Verification_ventilation.Verification()
     if len(tracks) > 0:
         dlg = wx.MessageDialog(
             self,
             _(u"Un ou plusieurs règlements peuvent être ventilés.\n\nSouhaitez-vous le faire maintenant (conseillé) ?"
               ), _(u"Ventilation"),
             wx.YES_NO | wx.YES_DEFAULT | wx.CANCEL | wx.ICON_EXCLAMATION)
         reponse = dlg.ShowModal()
         dlg.Destroy()
         if reponse == wx.ID_YES:
             dlg = DLG_Verification_ventilation.Dialog(
                 self)  #, tracks=tracks)
             dlg.ShowModal()
             dlg.Destroy()
         if reponse == wx.ID_CANCEL:
             return False
     return True
Beispiel #3
0
 def MenuGenererDevis(self, event):
     if UTILS_Utilisateurs.VerificationDroitsUtilisateurActuel("familles_devis", "creer") == False : return
     # Récupération du IDcompte_payeur
     IDcompte_payeur = self.GetIDcomptePayeur()
     # Vérification de la ventilation
     from Dlg import DLG_Verification_ventilation
     tracks = DLG_Verification_ventilation.Verification(IDcompte_payeur)
     if len(tracks) > 0 :
         dlg = wx.MessageDialog(self, _(u"Un ou plusieurs règlements sont encore à ventiler.\n\nVous devez obligatoirement effectuer cela avant d'éditer un devis..."), _(u"Ventilation"), wx.OK | wx.ICON_EXCLAMATION)
         dlg.ShowModal()
         dlg.Destroy()
         return
     # Ouverture de la facturation
     from Dlg import DLG_Impression_devis
     dlg = DLG_Impression_devis.Dialog(self, IDfamille=self.IDfamille)
     dlg.ShowModal()
     dlg.Destroy()