def __init__(self, parent, clsbase=None):
        wx.Panel.__init__(self, parent, id=-1, name="panel_calendrier", style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.clsbase = clsbase
        self.MAJ_effectuee = False

        # Prévisions
        self.staticbox_previsions_staticbox = wx.StaticBox(self, -1, _(u"Présences prévisionnelles"))
        self.ctrl_previsions = Notebook(self, clsbase)
        try :
            self.ctrl_previsions.SetBackgroundColour(self.GetParent().GetThemeBackgroundColour())
        except :
            pass

        # Absences
        self.staticbox_absences_staticbox = wx.StaticBox(self, -1, _(u"Absences RTT"))
        self.label_absences_prevues = wx.StaticText(self, -1, _(u"Prévues :"))
        self.ctrl_absences_prevues = CTRL_Saisie_duree.CTRL(self, size=(50, -1))
        self.label_absences_prises = wx.StaticText(self, -1, _(u"Prises :"))
        self.ctrl_absences_prises = CTRL_Saisie_duree.CTRL(self, size=(50, -1))
        self.ctrl_absences_prises.Enable(False)
        self.label_absences_solde = wx.StaticText(self, -1, _(u"Restantes :"))
        self.ctrl_absences_solde = CTRL_Saisie_duree.CTRL(self, size=(50, -1))
        self.ctrl_absences_solde.Enable(False)

        # Options
        self.staticbox_options_staticbox = wx.StaticBox(self, -1, _(u"Options"))
        self.label_arrondi = wx.StaticText(self, -1, _(u"Arrondi :"))
        self.liste_arrondi_type = [(None, _(u"Aucun")), ("tranche_horaire", _(u"Tranche horaire")), ("duree", _(u"Durée"))]
        self.liste_arrondi_delta = [(10, _(u"10 min")), (15, _(u"15 min")), (30, _(u"30 min")), (60, _(u"60 min"))]
        self.ctrl_arrondi_type = wx.Choice(self, -1, choices=[label for code, label in self.liste_arrondi_type])
        self.ctrl_arrondi_delta = wx.Choice(self, -1, choices=[label for code, label in self.liste_arrondi_delta])

        self.__set_properties()
        self.__do_layout()

        # Binds
        self.Bind(wx.EVT_TEXT, self.OnChangeAbsencesPrevues, self.ctrl_absences_prevues)
        self.Bind(wx.EVT_CHOICE, self.OnChoixArrondi, self.ctrl_arrondi_type)
        self.Bind(wx.EVT_CHOICE, self.OnChoixArrondi, self.ctrl_arrondi_delta)

        # Init
        self.OnChangeAbsencesPrevues()
        self.ctrl_arrondi_type.SetSelection(0)
        self.ctrl_arrondi_delta.SetSelection(0)
        # self.OnChoixArrondi()
        self.ctrl_arrondi_delta.Enable(self.ctrl_arrondi_type.GetSelection() != 0)
    def __init__(self, parent, clsbase=None):
        wx.Panel.__init__(self, parent, id=-1, name="panel_tarification", style=wx.TAB_TRAVERSAL)
        self.parent = parent
        self.clsbase = clsbase
        self.MAJ_effectuee = False

        # Tarifs
        self.staticbox_tarifs_staticbox = wx.StaticBox(self, -1, _(u"Tarifs"))
        self.listviewAvecFooter = OL_Contratspsu_tarifs.ListviewAvecFooter(self, kwargs={"clsbase" : clsbase})
        self.ctrl_tarifs = self.listviewAvecFooter.GetListview()
        self.ctrl_recherche = OL_Contratspsu_tarifs.CTRL_Outils(self, listview=self.ctrl_tarifs, afficherCocher=False)
        if self.parent.GetName() == "notebook" :
            self.ctrl_recherche.SetBackgroundColour(self.parent.GetThemeBackgroundColour())

        self.bouton_tarifs_ajouter = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_tarifs_modifier = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_tarifs_supprimer = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Supprimer.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_tarifs_apercu = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Apercu.png"), wx.BITMAP_TYPE_ANY))
        self.bouton_tarifs_imprimer = wx.BitmapButton(self, -1, wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Imprimante.png"), wx.BITMAP_TYPE_ANY))

        # Options
        self.staticbox_options_staticbox = wx.StaticBox(self, -1, _(u"Options"))
        self.label_regularisation = wx.StaticText(self, -1, _(u"Heures de régularisation :"))
        self.ctrl_regularisation = CTRL_Saisie_duree.CTRL(self, size=(50, -1))
        self.label_tolerance = wx.StaticText(self, -1, _(u"Tolérance dépassement :"))
        self.ctrl_tolerance = CTRL_Saisie_duree.CTRL(self, size=(50, -1))

        self.__set_properties()
        self.__do_layout()

        # Binds
        self.Bind(wx.EVT_BUTTON, self.ctrl_tarifs.Ajouter, self.bouton_tarifs_ajouter)
        self.Bind(wx.EVT_BUTTON, self.ctrl_tarifs.Modifier, self.bouton_tarifs_modifier)
        self.Bind(wx.EVT_BUTTON, self.ctrl_tarifs.Supprimer, self.bouton_tarifs_supprimer)
        self.Bind(wx.EVT_BUTTON, self.ctrl_tarifs.Apercu, self.bouton_tarifs_apercu)
        self.Bind(wx.EVT_BUTTON, self.ctrl_tarifs.Imprimer, self.bouton_tarifs_imprimer)
Ejemplo n.º 3
0
    def __init__(self, parent, IDprestation=None, IDfamille=None):
        wx.Dialog.__init__(self,
                           parent,
                           -1,
                           name="DLG_Saisie_prestation",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
                           | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX)
        self.parent = parent
        self.IDprestation = IDprestation
        self.IDfamille = IDfamille
        self.ancienMontant = 0.0
        self.IDfacture = None

        # Recherche du IDcompte_payeur
        DB = GestionDB.DB()
        req = """SELECT IDcompte_payeur
        FROM comptes_payeurs 
        WHERE IDfamille=%d;""" % self.IDfamille
        DB.ExecuterReq(req)
        listeDonnees = DB.ResultatReq()
        DB.Close()
        self.IDcompte_payeur = listeDonnees[0][0]

        if self.IDprestation == None:
            self.SetTitle(_(u"Saisie d'une prestation"))
            titre = _(u"Saisie d'une prestation")
        else:
            self.SetTitle(_(u"Modification d'une prestation"))
            titre = _(u"Modification d'une prestation")
        intro = _(
            u"Vous pouvez saisir ou modifier ici les caractéristiques d'une prestation. Cela peut être utile lorsque vous devez saisir une prestation exceptionnelle pour un individu ou une famille (ex.: frais de dossier, pénalité, report...) ou quand certains paramètres doivent être modifiés manuellement."
        )
        self.ctrl_bandeau = CTRL_Bandeau.Bandeau(
            self,
            titre=titre,
            texte=intro,
            hauteurHtml=30,
            nomImage="Images/32x32/Euro.png")

        # Généralités
        self.staticbox_generalites_staticbox = wx.StaticBox(
            self, -1, _(u"Généralites"))
        self.label_date = wx.StaticText(self, -1, _(u"Date :"))
        self.ctrl_date = CTRL_Saisie_date.Date2(self)
        self.label_categorie = wx.StaticText(self, -1, _(u"Catégorie :"))
        self.ctrl_categorie = Choix_categorie(self)
        ##        self.ctrl_categorie.Enable(False)
        self.label_label = wx.StaticText(self, -1, _(u"Intitulé :"))
        self.ctrl_label = wx.TextCtrl(self, -1, u"")
        self.label_type = wx.StaticText(self, -1, _(u"Type :"))
        self.radio_type_familiale = wx.RadioButton(self,
                                                   -1,
                                                   _(u"Prestation familiale"),
                                                   style=wx.RB_GROUP)
        self.radio_type_individuelle = wx.RadioButton(
            self, -1, _(u"Prestation individuelle :"))
        self.ctrl_individu = Choix_individu(self, self.IDfamille)

        # Facturation
        self.staticbox_facturation_staticbox = wx.StaticBox(
            self, -1, _(u"Facturation"))
        self.label_activite = wx.StaticText(self, -1, _(u"Activité :"))
        self.ctrl_activite = Choix_activite(self)
        self.label_categorie_tarif = wx.StaticText(self, -1,
                                                   _(u"Catégorie :"))
        self.ctrl_categorie_tarif = Choix_categorie_tarif(self)
        self.label_tarif = wx.StaticText(self, -1, _(u"Tarif :"))
        self.ctrl_tarif = Choix_tarif(self)
        self.label_facture = wx.StaticText(self, -1, _(u"Facture :"))
        self.ctrl_facture = wx.StaticText(self, -1, _(u"Non facturé"))
        self.label_temps = wx.StaticText(self, -1, _(u"Temps facturé :"))
        self.ctrl_temps = CTRL_Saisie_duree.CTRL(self, size=(80, -1))

        # TVA
        self.label_tva = wx.StaticText(self, -1, _(u"Taux TVA (%) :"))
        self.ctrl_tva = FS.FloatSpin(self,
                                     -1,
                                     min_val=0,
                                     max_val=100,
                                     increment=0.1,
                                     agwStyle=FS.FS_RIGHT)
        self.ctrl_tva.SetFormat("%f")
        self.ctrl_tva.SetDigits(2)
        self.ctrl_tva.SetMinSize((70, -1))

        # Code comptable
        self.label_code_comptable = wx.StaticText(self, -1,
                                                  _(u"Code compta :"))
        self.ctrl_code_comptable = wx.TextCtrl(self, -1, u"")
        self.ctrl_code_comptable.SetMinSize((50, -1))
        self.label_code_produit_local = wx.StaticText(
            self, -1, _(u"Code produit local :"))
        self.ctrl_code_produit_local = wx.TextCtrl(self, -1, "")
        self.ctrl_code_produit_local.SetMinSize((50, -1))

        # Montants
        self.label_montant_avant_deduc = wx.StaticText(
            self, -1,
            _(u"Montant TTC (%s) :") % SYMBOLE)
        self.ctrl_montant_avant_deduc = CTRL_Saisie_euros.CTRL(self)
        self.ctrl_montant_avant_deduc.SetMinSize((100, -1))
        self.label_montant = wx.StaticText(
            self, -1,
            _(u"Montant final TTC (%s) :") % SYMBOLE)
        self.ctrl_montant = CTRL_Saisie_euros.CTRL(
            self, font=wx.Font(13, wx.DEFAULT, wx.NORMAL, wx.BOLD, 0, u""))
        self.ctrl_montant.SetBackgroundColour("#F0FBED")
        self.ctrl_montant.SetEditable(False)
        self.ctrl_montant.SetMinSize((100, -1))

        # Déductions associées
        self.staticbox_deductions_staticbox = wx.StaticBox(
            self, -1, _(u"Déductions"))
        if self.IDprestation == None:
            IDprestationTemp = 0
        else:
            IDprestationTemp = self.IDprestation
        self.ctrl_deductions = OL_Deductions.ListView(
            self,
            id=-1,
            IDprestation=IDprestationTemp,
            IDcompte_payeur=self.IDcompte_payeur,
            modificationsVirtuelles=True,
            style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_SINGLE_SEL
            | wx.LC_HRULES | wx.LC_VRULES)
        self.ctrl_deductions.SetMinSize((20, 100))

        self.bouton_ajouter = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Ajouter.png"),
                      wx.BITMAP_TYPE_ANY))
        self.bouton_modifier = wx.BitmapButton(
            self, -1,
            wx.Bitmap(Chemins.GetStaticPath(u"Images/16x16/Modifier.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))

        # Consommations associées
        self.staticbox_consommations_staticbox = wx.StaticBox(
            self, -1, _(u"Consommations associées"))
        self.ctrl_consommations = OL_Consommations.ListView(
            self,
            id=-1,
            style=wx.LC_REPORT | wx.SUNKEN_BORDER | wx.LC_SINGLE_SEL
            | wx.LC_HRULES | wx.LC_VRULES)
        self.ctrl_consommations.SetMinSize((20, 100))

        # Commandes
        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_CHOICE, self.OnChoixCategorie, self.ctrl_categorie)
        self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioType,
                  self.radio_type_familiale)
        self.Bind(wx.EVT_RADIOBUTTON, self.OnRadioType,
                  self.radio_type_individuelle)
        self.Bind(wx.EVT_CHOICE, self.OnChoixActivite, self.ctrl_activite)
        self.Bind(wx.EVT_CHOICE, self.OnChoixCategorieTarif,
                  self.ctrl_categorie_tarif)
        self.Bind(wx.EVT_CHOICE, self.OnChoixTarif, self.ctrl_tarif)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAjouter, self.bouton_ajouter)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonModifier, self.bouton_modifier)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonSupprimer, self.bouton_supprimer)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonAide, self.bouton_aide)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonOk, self.bouton_ok)

        self.ctrl_categorie_tarif.Enable(False)
        self.ctrl_tarif.Enable(False)

        # Remplissage des contrôles
        self.listeActivites = self.Importation_activites()
        self.ctrl_activite.SetListeDonnees(self.listeActivites)

        self.listeCategoriesTarifs = self.Importation_categories_tarifs(
            IDactivite=0)
        self.ctrl_categorie_tarif.SetListeDonnees(self.listeCategoriesTarifs)

        self.listeTarifs = self.Importation_tarifs(IDcategorie_tarif=0)
        self.ctrl_tarif.SetListeDonnees(self.listeTarifs)

        # Importation lors d'une modification
        if self.IDprestation != None:
            self.Importation()
        else:
            self.ctrl_consommations.SetIDprestation(IDprestation)
            self.ctrl_date.SetDate(datetime.date.today())

        self.ctrl_deductions.MAJ()

        ##        # Saisie du montant initial de la prestation
        ##        totalDeductions = self.ctrl_deductions.GetTotalDeductions()
        ##        montantInitial = self.ctrl_montant.GetMontant() + totalDeductions
        ##        self.ctrl_montant_avant_deduc.SetMontant(montantInitial)

        # MAJ des contrôles
        self.OnRadioType(None)

        self.Bind(wx.EVT_TEXT, self.OnTextMontant,
                  self.ctrl_montant_avant_deduc)
Ejemplo n.º 4
0
 def TimedeltaEditor(olv, rowIndex, subItemIndex):
     ctrl = CTRL_Saisie_duree.CTRL(self)
     return ctrl