def __init__(self, parent, filtres=[], codesColonnes = ["IDfacture", "date", "numero", "famille", "prelevement", "email", "total", "solde", "solde_actuel", "date_echeance", "nom_lot"], checkColonne = True, triColonne = "numero"): wx.Panel.__init__(self, parent, id=-1, name="CTRL_Liste_factures", style=wx.TAB_TRAVERSAL) self.parent = parent # Liste des factures self.listviewAvecFooter = OL_Factures.ListviewAvecFooter(self, kwargs={"codesColonnes" : codesColonnes, "checkColonne" : checkColonne, "triColonne" : triColonne}) self.ctrl_factures = self.listviewAvecFooter.GetListview() # Ctrl des filtres de sélection self.ctrl_filtres = DLG_Filtres_factures.CTRL_Filtres(self, filtres=filtres, ctrl_factures=self.ctrl_factures) # Commandes de liste self.bouton_apercu = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Apercu.png"), wx.BITMAP_TYPE_ANY)) self.bouton_email = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Emails_exp.png"), wx.BITMAP_TYPE_ANY)) self.bouton_supprimer = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Supprimer.png"), wx.BITMAP_TYPE_ANY)) self.bouton_liste_apercu = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Apercu.png"), wx.BITMAP_TYPE_ANY)) self.bouton_liste_imprimer = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Imprimante.png"), wx.BITMAP_TYPE_ANY)) self.bouton_liste_export_texte = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Texte2.png"), wx.BITMAP_TYPE_ANY)) self.bouton_liste_export_excel = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Excel.png"), wx.BITMAP_TYPE_ANY)) # Options de liste self.ctrl_recherche = OL_Factures.BarreRecherche(self, listview=self.ctrl_factures) self.ctrl_afficher_annulations = wx.CheckBox(self, -1, u"Afficher les factures annulées") self.hyper_tout = Hyperlien(self, label=_(u"Tout cocher"), infobulle=_(u"Cliquez ici pour tout cocher"), URL="tout") self.label_separation = wx.StaticText(self, -1, "|") self.hyper_rien = Hyperlien(self, label=_(u"Tout décocher"), infobulle=_(u"Cliquez ici pour tout décocher"), URL="rien") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.OnBoutonApercu, self.bouton_apercu) self.Bind(wx.EVT_BUTTON, self.OnBoutonEmail, self.bouton_email) self.Bind(wx.EVT_BUTTON, self.OnBoutonSupprimer, self.bouton_supprimer) self.Bind(wx.EVT_BUTTON, self.OnBoutonListeApercu, self.bouton_liste_apercu) self.Bind(wx.EVT_BUTTON, self.OnBoutonListeImprimer, self.bouton_liste_imprimer) self.Bind(wx.EVT_BUTTON, self.OnBoutonListeExportTexte, self.bouton_liste_export_texte) self.Bind(wx.EVT_BUTTON, self.OnBoutonListeExportExcel, self.bouton_liste_export_excel) self.Bind(wx.EVT_CHECKBOX, self.OnCheckAnnulations, self.ctrl_afficher_annulations)
def __init__(self, parent): wx.Panel.__init__(self, parent, id=-1, name="DLG_Factures_generation_actions", style=wx.TAB_TRAVERSAL) self.parent = parent # Liste de factures self.box_factures_staticbox = wx.StaticBox(self, -1, _(u"Factures")) codesColonnes = ["IDfacture", "date", "numero", "famille", "prelevement", "email", "total", "solde", "solde_actuel", "date_echeance", "nom_lot"] checkColonne = False triColonne = "IDfacture" self.ctrl_factures = OL_Factures.ListView(self, id=-1, codesColonnes=codesColonnes, checkColonne=checkColonne, triColonne=triColonne, style=wx.LC_HRULES|wx.LC_VRULES|wx.LC_REPORT|wx.SUNKEN_BORDER|wx.LC_SINGLE_SEL) self.ctrl_factures.SetMinSize((100, 100)) self.bouton_apercu = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Apercu.png"), wx.BITMAP_TYPE_ANY)) self.bouton_email_facture = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Emails_exp.png"), wx.BITMAP_TYPE_ANY)) self.bouton_supprimer = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Supprimer.png"), wx.BITMAP_TYPE_ANY)) self.bouton_apercu_liste = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Apercu.png"), wx.BITMAP_TYPE_ANY)) self.bouton_imprimer_liste = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Imprimante.png"), wx.BITMAP_TYPE_ANY)) self.bouton_export_texte = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Texte2.png"), wx.BITMAP_TYPE_ANY)) self.bouton_export_excel = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Excel.png"), wx.BITMAP_TYPE_ANY)) # Actions self.box_actions_staticbox = wx.StaticBox(self, -1, _(u"Autres actions possibles")) self.image_fleche1 = wx.StaticBitmap(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Fleche_droite.png"), wx.BITMAP_TYPE_ANY)) self.image_fleche2 = wx.StaticBitmap(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Fleche_droite.png"), wx.BITMAP_TYPE_ANY)) self.image_fleche3 = wx.StaticBitmap(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/16x16/Fleche_droite.png"), wx.BITMAP_TYPE_ANY)) self.bouton_helios = CTRL_Bouton_image.CTRL(self, texte=_(u"Exporter\nvers Hélios"), tailleImage=(32, 32), margesImage=(4, 0, 0, 0), margesTexte=(-5, 1), cheminImage="Images/32x32/Helios.png") self.bouton_prelevements = CTRL_Bouton_image.CTRL(self, texte=_(u"Prélèvement\nautomatique"), tailleImage=(32, 32), margesImage=(4, 0, 0, 0), margesTexte=(-5, 1), cheminImage="Images/32x32/Prelevement.png") self.bouton_email = CTRL_Bouton_image.CTRL(self, texte=_(u"Transmettre\npar Email"), tailleImage=(32, 32), margesImage=(4, 4, 0, 0), margesTexte=(-5, 1), cheminImage="Images/32x32/Emails_exp.png") self.bouton_imprimer = CTRL_Bouton_image.CTRL(self, texte=_(u"Imprimer"), tailleImage=(32, 32), margesImage=(4, 0, 0, 0), margesTexte=(-5, 1), cheminImage="Images/32x32/Imprimante.png") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.OnBoutonApercu, self.bouton_apercu) self.Bind(wx.EVT_BUTTON, self.OnBoutonEmailFacture, self.bouton_email_facture) self.Bind(wx.EVT_BUTTON, self.OnBoutonSupprimer, self.bouton_supprimer) self.Bind(wx.EVT_BUTTON, self.OnBoutonApercuListe, self.bouton_apercu_liste) self.Bind(wx.EVT_BUTTON, self.OnBoutonImprimerListe, self.bouton_imprimer_liste) self.Bind(wx.EVT_BUTTON, self.OnBoutonExportTexte, self.bouton_export_texte) self.Bind(wx.EVT_BUTTON, self.OnBoutonExportExcel, self.bouton_export_excel) self.Bind(wx.EVT_BUTTON, self.OnBoutonPrelevements, self.bouton_prelevements) self.Bind(wx.EVT_BUTTON, self.OnBoutonEmail, self.bouton_email) self.Bind(wx.EVT_BUTTON, self.OnBoutonHelios, self.bouton_helios) self.Bind(wx.EVT_BUTTON, self.OnBoutonImprimer, self.bouton_imprimer)
def __init__(self, parent, IDfamille=None): wx.Panel.__init__(self, parent, id=-1, name="panel_factures", style=wx.TAB_TRAVERSAL) self.parent = parent self.IDfamille = IDfamille self.IDcompte_payeur = None self.staticbox_factures = wx.StaticBox(self, -1, _(u"Factures")) # OL Factures codesColonnes = [ "IDfacture", "date", "numero", "date_debut", "date_fin", "total", "solde", "solde_actuel", "date_echeance", "nom_lot" ] checkColonne = True triColonne = "IDfacture" self.listviewAvecFooter = OL_Factures.ListviewAvecFooter( self, kwargs={ "codesColonnes": codesColonnes, "checkColonne": checkColonne, "triColonne": triColonne, "afficherAnnulations": True }) self.ctrl_listview = self.listviewAvecFooter.GetListview() self.ctrl_recherche = OL_Factures.CTRL_Outils( self, listview=self.ctrl_listview, afficherCocher=True) self.ctrl_recherche.SetBackgroundColour((255, 255, 255)) # Commandes boutons self.bouton_ajouter = wx.BitmapButton( self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"), wx.BITMAP_TYPE_ANY)) self.bouton_supprimer = wx.BitmapButton( self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Supprimer.png"), wx.BITMAP_TYPE_ANY)) self.bouton_imprimer = wx.BitmapButton( self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Apercu.png"), wx.BITMAP_TYPE_ANY)) self.bouton_email = wx.BitmapButton( self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Emails_exp.png"), wx.BITMAP_TYPE_ANY)) # Prélèvement self.ctrl_email = CTRL_Email(self, IDfamille) # Binds self.Bind(wx.EVT_BUTTON, self.OnBoutonAjouter, self.bouton_ajouter) self.Bind(wx.EVT_BUTTON, self.OnBoutonSupprimer, self.bouton_supprimer) self.Bind(wx.EVT_BUTTON, self.OnBoutonImprimer, self.bouton_imprimer) self.Bind(wx.EVT_BUTTON, self.OnBoutonEmail, self.bouton_email) # Propriétés self.bouton_ajouter.SetToolTipString( _(u"Cliquez ici pour créer une facture pour cette famille")) self.bouton_supprimer.SetToolTipString( _(u"Cliquez ici pour supprimer la facture sélectionnée")) self.bouton_imprimer.SetToolTipString( _(u"Cliquez ici pour rééditer la facture sélectionnée (PDF)")) self.bouton_email.SetToolTipString( _(u"Cliquez ici pour envoyer la facture sélectionnée par Email")) # Layout grid_sizer_base = wx.FlexGridSizer(rows=1, cols=2, vgap=5, hgap=5) staticbox_factures = wx.StaticBoxSizer(self.staticbox_factures, wx.VERTICAL) grid_sizer_factures = wx.FlexGridSizer(rows=2, cols=2, vgap=5, hgap=5) grid_sizer_factures.Add(self.listviewAvecFooter, 1, wx.EXPAND, 0) grid_sizer_boutons = wx.FlexGridSizer(rows=7, cols=1, vgap=5, hgap=5) grid_sizer_boutons.Add(self.bouton_ajouter, 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_supprimer, 0, wx.ALL, 0) grid_sizer_boutons.Add((5, 5), 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_imprimer, 0, wx.ALL, 0) grid_sizer_boutons.Add(self.bouton_email, 0, wx.ALL, 0) grid_sizer_factures.Add(grid_sizer_boutons, 1, wx.ALL, 0) grid_sizer_options = wx.FlexGridSizer(rows=1, cols=5, vgap=5, hgap=5) grid_sizer_options.Add(self.ctrl_email, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 0) grid_sizer_options.Add((70, 5), 0, wx.ALL, 0) grid_sizer_options.Add(self.ctrl_recherche, 0, wx.EXPAND | wx.ALL, 0) grid_sizer_options.AddGrowableCol(2) grid_sizer_factures.Add(grid_sizer_options, 1, wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 0) grid_sizer_factures.AddGrowableCol(0) grid_sizer_factures.AddGrowableRow(0) staticbox_factures.Add(grid_sizer_factures, 1, wx.EXPAND | wx.ALL, 5) grid_sizer_base.Add(staticbox_factures, 1, wx.EXPAND | wx.ALL, 5) self.SetSizer(grid_sizer_base) grid_sizer_base.Fit(self) grid_sizer_base.AddGrowableCol(0) grid_sizer_base.AddGrowableRow(0)