def __init__(self, parent, IDdepot=None):
        wx.Dialog.__init__(self, parent, -1, name="DLG_Saisie_depot", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX|wx.THICK_FRAME)
        self.parent = parent
        self.IDdepot = IDdepot
        
        # Reglements
        self.staticbox_parametres_staticbox = wx.StaticBox(self, -1, _(u"Paramètres"))
        self.label_nom = wx.StaticText(self, -1, _(u"Nom du dépôt :"))
        self.ctrl_nom = wx.TextCtrl(self, -1, u"", size=(300, -1))
        self.label_date = wx.StaticText(self, -1, _(u"Date du dépôt :"))
        self.ctrl_date = CTRL_Saisie_date.Date2(self)
        self.label_verrouillage = wx.StaticText(self, -1, _(u"Verrouillage :"))
        self.ctrl_verrouillage = wx.CheckBox(self, -1, u"")
        self.label_code_compta = wx.StaticText(self, -1, _(u"Code compta :"))
        self.ctrl_code_compta = wx.TextCtrl(self, -1, u"")
        self.label_compte = wx.StaticText(self, -1, _(u"Compte bancaire :"))
        self.ctrl_compte = Choix_compte(self)
        self.label_observations = wx.StaticText(self, -1, _(u"Observations :"))
        self.ctrl_observations = wx.TextCtrl(self, -1, u"", style=wx.TE_MULTILINE)
        
        # Reglements
        self.staticbox_reglements_staticbox = wx.StaticBox(self, -1, _(u"Règlements"))
        self.listviewAvecFooter = OL_Reglements_depots.ListviewAvecFooter(self, kwargs={"inclus" : True, "selectionPossible" : False}) 
        self.ctrl_reglements = self.listviewAvecFooter.GetListview()
        
        self.ctrl_infos = CTRL_Infos(self, hauteur=32, couleurFond="#F0FBED" , style=wx.html.HW_NO_SELECTION | wx.html.HW_SCROLLBAR_NEVER | wx.SUNKEN_BORDER)
        self.bouton_ajouter = CTRL_Bouton_image.CTRL(self, texte=_(u"Ajouter ou retirer des règlements"), cheminImage="Images/32x32/Reglement_ajouter.png")
        
        # Boutons
        self.bouton_aide = CTRL_Bouton_image.CTRL(self, texte=_(u"Aide"), cheminImage="Images/32x32/Aide.png")
        self.bouton_imprimer = CTRL_Bouton_image.CTRL(self, texte=_(u"Imprimer"), cheminImage="Images/32x32/Imprimante.png")
        self.bouton_avis_depots = CTRL_Bouton_image.CTRL(self, texte=_(u"Envoyer les avis de dépôt"), cheminImage="Images/32x32/Emails_exp.png")
        self.bouton_ok = CTRL_Bouton_image.CTRL(self, texte=_(u"Ok"), cheminImage="Images/32x32/Valider.png")
        self.bouton_annuler = CTRL_Bouton_image.CTRL(self, texte=_(u"Annuler"), cheminImage="Images/32x32/Annuler.png")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.OnBoutonAjouter, self.bouton_ajouter)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonImprimer, self.bouton_imprimer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAvisDepots, self.bouton_avis_depots)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonOk, self.bouton_ok)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAnnuler, self.bouton_annuler)
        self.Bind(wx.EVT_CHECKBOX, self.OnCheckVerrouillage, self.ctrl_verrouillage)
        
        # Importation lors d'une modification
        if self.IDdepot != None :
            self.SetTitle(_(u"Modification d'un dépôt"))
            self.Importation() 
            self.OnCheckVerrouillage(None)
        else:
            self.SetTitle(_(u"Saisie d'un dépôt"))
            self.ctrl_date.SetDate(datetime.date.today())
        
        # Importation des règlements
        self.tracks = self.GetTracks()
        self.ctrl_reglements.MAJ(tracks=self.tracks) 
        self.MAJinfos() 
Exemple #2
0
    def __init__(self, parent):
        wx.Dialog.__init__(self, parent, -1, name="DLG_Depots", style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.MAXIMIZE_BOX|wx.MINIMIZE_BOX)
        self.parent = parent
        
        # Bandeau
        intro = _(u"Vous pouvez ici saisir, modifier ou supprimer des dépôts bancaires. ")
        titre = _(u"Gestion des dépôts")
        self.ctrl_bandeau = CTRL_Bandeau.Bandeau(self, titre=titre, texte=intro, hauteurHtml=30, nomImage="Images/32x32/Banque.png")
        
        # Reglements disponibles
        self.staticbox_reglements = wx.StaticBox(self, -1, _(u"Règlements disponibles"))
        self.listviewAvecFooter1 = OL_Reglements_depots.ListviewAvecFooter(self, kwargs={"inclus" : False, "selectionPossible" : False, "size" : (-1, 180) }) 
        self.ctrl_reglements = self.listviewAvecFooter1.GetListview()
        self.ctrl_reglements.SetMinSize((100, 150))

        # Dépôts
        self.staticbox_depots = wx.StaticBox(self, -1, _(u"Dépôts"))
        self.listviewAvecFooter2 = OL_Depots.ListviewAvecFooter(self, kwargs={}) 
        self.ctrl_depots = self.listviewAvecFooter2.GetListview()
        self.ctrl_recherche = OL_Depots.CTRL_Outils(self, listview=self.ctrl_depots)

        self.bouton_ajouter = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Ajouter.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_modifier = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Modifier.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_supprimer = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Supprimer.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_imprimer = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Imprimante.png"), wx.BITMAP_TYPE_ANY))
        
        # Options
        self.check_images = wx.CheckBox(self, -1, _(u"Afficher les images des modes et émetteurs"))
        self.check_images.SetValue(UTILS_Config.GetParametre("depots_afficher_images", defaut=True))
        
        # Boutons
        self.bouton_aide = CTRL_Bouton_image.CTRL(self, texte=_(u"Aide"), cheminImage="Images/32x32/Aide.png")
        self.bouton_fermer = CTRL_Bouton_image.CTRL(self, id=wx.ID_CANCEL, texte=_(u"Fermer"), cheminImage="Images/32x32/Fermer.png")

        self.__set_properties()
        self.__do_layout()
        
        self.Bind(wx.EVT_BUTTON, self.Ajouter, self.bouton_ajouter)
        self.Bind(wx.EVT_BUTTON, self.Modifier, self.bouton_modifier)
        self.Bind(wx.EVT_BUTTON, self.Supprimer, self.bouton_supprimer)
        self.Bind(wx.EVT_CHECKBOX, self.OnCheckImages, self.check_images)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonImprimer, self.bouton_imprimer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)

        # Init
        self.MAJreglements()
        self.ctrl_depots.MAJ()
    def __init__(self, parent, tracks=[], IDcompte=None):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           name="DLG_Saisie_depot_ajouter",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
                           | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX)
        self.parent = parent
        self.tracks = tracks
        self.IDcompte = IDcompte

        self.label_intro = wx.StaticText(
            self,
            -1,
            _(u"Double-cliquez sur un règlement pour l'affecter ou non au dépôt."
              ),
            style=wx.ALIGN_CENTER)

        self.label_compte = wx.StaticText(self, -1, _(u"Compte :"))
        self.ctrl_compte = CTRL_Compte(self)
        self.ctrl_compte.SetMinSize((130, -1))
        self.ctrl_compte.SetID(self.IDcompte)

        self.label_mode = wx.StaticText(self, -1, _(u"Mode :"))
        self.ctrl_mode = CTRL_Modes(self)
        self.ctrl_mode.SetMinSize((130, -1))

        self.label_tri = wx.StaticText(self, -1, _(u"Tri :"))
        self.ctrl_tri = wx.Choice(self,
                                  -1,
                                  choices=(_(u"Ordre de saisie"), _(u"Date"),
                                           _(u"Mode de règlement"),
                                           _(u"Emetteur"),
                                           _(u"Numéro de pièce"),
                                           _(u"Nom de payeur"), _(u"Montant"),
                                           _(u"Avis"), _(u"Compte"),
                                           _(u"Différé"), _(u"Attente"),
                                           _(u"Quittancier"),
                                           _(u"Observations")))
        self.ctrl_tri.Select(0)

        self.label_ordre = wx.StaticText(self, -1, _(u"Ordre :"))
        self.ctrl_ordre = wx.Choice(self,
                                    -1,
                                    choices=(_(u"Ascendant"),
                                             _(u"Descendant")))
        self.ctrl_ordre.Select(0)

        # Reglements disponibles
        self.staticbox_reglements_disponibles_staticbox = wx.StaticBox(
            self, -1, _(u"Règlements disponibles"))
        ##        self.ctrl_reglements_disponibles = OL_Reglements_depots.ListView(self, id=-1, inclus=False, name="OL_reglements_depot", style=wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_SINGLE_SEL|wx.LC_HRULES|wx.LC_VRULES)
        self.listviewAvecFooter1 = OL_Reglements_depots.ListviewAvecFooter(
            self,
            kwargs={
                "inclus":
                False,
                "sortable":
                True,
                "style":
                wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_HRULES | wx.LC_VRULES
                | wx.LB_MULTIPLE
            })
        self.ctrl_reglements_disponibles = self.listviewAvecFooter1.GetListview(
        )

        # Commandes
        self.bouton_bas_tout = wx.BitmapButton(
            self, -1,
            wx.Bitmap(
                Chemins.GetStaticPath(u"Images/16x16/Fleche_double_bas.png"),
                wx.BITMAP_TYPE_ANY))
        self.bouton_bas = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Fleche_bas.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_haut = wx.BitmapButton(
            self, -1,
            wx.Bitmap(
                Chemins.GetStaticPath(u"Images/16x16/Fleche_haut_rouge.png"),
                wx.BITMAP_TYPE_ANY))
        self.bouton_haut_tout = wx.BitmapButton(
            self, -1,
            wx.Bitmap(
                Chemins.GetStaticPath(
                    u"Images/16x16/Fleche_double_haut_rouge.png"),
                wx.BITMAP_TYPE_ANY))

        # Reglements du dépôt
        self.staticbox_reglements_depot_staticbox = wx.StaticBox(
            self, -1, _(u"Règlements du dépôt"))
        ##        self.ctrl_reglements_depot = OL_Reglements_depots.ListView(self, id=-1, inclus=True, name="OL_reglements_depot", style=wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_SINGLE_SEL|wx.LC_HRULES|wx.LC_VRULES)
        self.listviewAvecFooter2 = OL_Reglements_depots.ListviewAvecFooter(
            self,
            kwargs={
                "inclus":
                True,
                "style":
                wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_HRULES | wx.LC_VRULES
                | wx.LB_MULTIPLE
            })
        self.ctrl_reglements_depot = self.listviewAvecFooter2.GetListview()

        # Boutons
        self.bouton_aide = CTRL_Bouton_image.CTRL(
            self, texte=_(u"Aide"), cheminImage="Images/32x32/Aide.png")
        self.bouton_ok = CTRL_Bouton_image.CTRL(
            self, texte=_(u"Ok"), cheminImage="Images/32x32/Valider.png")
        self.bouton_annuler = CTRL_Bouton_image.CTRL(
            self,
            id=wx.ID_CANCEL,
            texte=_(u"Annuler"),
            cheminImage="Images/32x32/Annuler.png")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.OnBoutonBasTout, self.bouton_bas_tout)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonBas, self.bouton_bas)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonHaut, self.bouton_haut)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonHautTout, self.bouton_haut_tout)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonOk, self.bouton_ok)
        self.Bind(wx.EVT_CHOICE, self.OnChoixCompte, self.ctrl_compte)
        self.Bind(wx.EVT_CHOICE, self.OnChoixMode, self.ctrl_mode)
        self.Bind(wx.EVT_CHOICE, self.OnChoixTri, self.ctrl_tri)
        self.Bind(wx.EVT_CHOICE, self.OnChoixOrdre, self.ctrl_ordre)

        # Initialisation des contrôles
        self.OnChoixTri(None)
        self.OnChoixOrdre(None)
        self.MAJListes(tracks=self.tracks)