Exemple #1
0
 def on_test_promowear_button_clicked(self, button):
     msg = _( """PROVIAMO IL MODULO DI TAGLIA E COLORE o PROMOWEAR, Procedo? """ )
     if not YesNoDialog(msg=msg, transient=self.getTopLevel()):
         return
     from data.createSchemaDb import orderedInstallPromoWear
     if orderedInstallPromoWear():
         if not setconf("PromoWear","mod_enable",value="yes"):
             a = SetConf()
             a.section = "PromoWear"
             a.tipo_section ="Modulo"
             a.description = "Modulo Taglia e colore"
             a.tipo = "bool"
             a.key = "mod_enable"
             a.value = "yes"
             a.persist()
     messageInfo(msg=_("RIAVVIA IL PROMOGEST"))
     Environment.delete_pickle()
     Environment.restart_program()
Exemple #2
0
def checkPan(main):
    print "TIPO PG", Environment.tipo_pg, Environment.modulesList
    for a in Environment.modulesList:
        if a:
            if ("FULL" in a) or ("STANDARD" in a) or ("PRO" in a):
                text = "OPZIONE: <b>%s</b>" %(Environment.tipo_pg)
                main.pan_label_info.set_markup(text)
                Environment.pg2log.info(text)
                if "+S" in a:
                    print "ATTIVARE SHOP"
                    if not setconf("VenditaDettaglio","mod_enable",value="yes"):
                        a = SetConf()
                        a.section = "VenditaDettaglio"
                        a.tipo_section ="Modulo"
                        a.description = "Modulo Vendita Dettaglio"
                        a.tipo = "bool"
                        a.key = "mod_enable"
                        a.value = "yes"
                        a.persist()

                        a = SetConf()
                        a.section = "VenditaDettaglio"
                        a.tipo_section ="Modulo"
                        a.description = "Nome del movimento generato"
                        a.tipo = "str"
                        a.key = "operazione"
                        a.value = "Scarico venduto da cassa"
                        a.persist()

                        a = SetConf()
                        a.section = "VenditaDettaglio"
                        a.tipo_section ="Modulo"
                        a.description = "disabilita_stampa"
                        a.tipo = "bool"
                        a.key = "disabilita_stampa"
                        a.value = "True"
                        a.active = True
                        a.persist()
                return
    if  Environment.tipodb!="postgresql":
        #pp = PanUi(main).draw()
        #a = gtk.Label()
        #a.set_text("OPZIONI MODULI")
        #main.main_notebook.prepend_page(pp.pan_frame, a)
        #main.main_notebook.set_current_page(0)
        text = "OPZIONE: <b>%s!</b>" %("ONE BASIC")
        main.pan_label_info.set_markup(text)
        #return pp
    else:
        text = "OPZIONE: <b>%s</b>" %(Environment.tipo_pg)
        main.pan_label_info.set_markup(text)
    Environment.pg2log.info(text)
Exemple #3
0
    def on_test_promoshop_button_clicked(self, button):
        from promogest.dao.Setconf import SetConf
        msg = _(""" PROVIAMO IL MODULO VENDITA DETTAGLIO o PROMOSHOP, Procedo? """)
        if not YesNoDialog(msg=msg, transient=self.getTopLevel()):
            return
        if not setconf("VenditaDettaglio","mod_enable",value="yes"):
            a = SetConf()
            a.section = "VenditaDettaglio"
            a.tipo_section ="Modulo"
            a.description = "Modulo Vendita Dettaglio"
            a.tipo = "bool"
            a.key = "mod_enable"
            a.value = "yes"
            a.persist()

            a = SetConf()
            a.section = "VenditaDettaglio"
            a.tipo_section ="Modulo"
            a.description = "Nome del movimento generato"
            a.tipo = "str"
            a.key = "operazione"
            a.value = "Scarico venduto da cassa"
            a.persist()

            a = SetConf()
            a.section = "VenditaDettaglio"
            a.tipo_section ="Modulo"
            a.description = "disabilita_stampa"
            a.tipo = "bool"
            a.key = "disabilita_stampa"
            a.value = "True"
            a.active = True
            a.persist()
            from data.createSchemaDb import orderedInstallVenditaDettaglio
            orderedInstallVenditaDettaglio()
            messageInfo(msg=_("RIAVVIA IL PROMOGEST"))
            Environment.delete_pickle()
            Environment.restart_program()

        else:
            messageInfo(msg=_("RISULTA GIA' ATTIVATO"))
Exemple #4
0
    def on_inserimento_codice_activate(self,widget):
        from promogest.dao.Setconf import SetConf
        dialog = gtk.MessageDialog(self.getTopLevel(),
                                   GTK_DIALOG_MODAL
                                   | GTK_DIALOG_DESTROY_WITH_PARENT,
                                   GTK_DIALOG_MESSAGE_INFO, GTK_BUTTON_OK)
        dialog.set_markup(_("""<b>                CODICE ATTIVAZIONE PACCHETTO               </b>"""))
        hbox = gtk.HBox()
        entry___ = gtk.Entry()

        label = gtk.Label()
        label.set_markup(_("<b>   Inserisci codice   </b>"))
        hbox.pack_start(label, True, True, 0)
        hbox.pack_start(entry___, True, True, 0)
        dialog.get_content_area().pack_start(hbox, True, True, 0)
        dialog.show_all()
        dialog.run()
        codice = entry___.get_text()
#        hascode = str(hashlib.sha224(codice+orda(codice)).hexdigest())
        if "cl" and "|" in codice :
            d = codice.split("|")
            if d[1] == "azienda":
                if Environment.tipodb == "sqlite":
                    from promogest.dao.Azienda import Azienda
                    oldnomeazienda = d[2]
                    newnameazienda = d[3]
                    aa = Azienda().select(schemaa = oldnomeazienda)
                    if aa:
                        aa[0].schemaa = newnameazienda.strip()
                        aa[0].persist()
                        messageInfo(msg=_("NOME AZIENDA MODIFICATO"))
                        dialog.destroy()
                        return
                    else:
                        messageInfo(msg=_("VECCHIO NOME AZIENDA NON TROVATO"))
                        dialog.destroy()
                        return
                    return
                else:
                    messageInfo(msg=_("POSSIBILE SOLO CON LA VERSIONE ONE"))
                    dialog.destroy()
                    return
            elif d[1] == "modulo":
                tipo_section = d[2]  # Modulo
                section = d[3]  # Inventario
                description = str(d[4]) or ""  # Gestione inventario
                tipo = d[5] or None  # Niente o BOOLEAN o colore
                active = bool(d[6]) or True  # bool
                visible = bool(d[7]) or True  # bool
                key = d[8]  # mod_enable
                value = d[9]  # yes or no
                if section not in Environment.modules_folders:
                    messageInfo(msg=_("ERRORE ATTIVAZIONE MODULO"))
                    return
                dao = SetConf().select(key=key, section=section)
                if dao:
                    d = dao[0]
                else:
                    d = SetConf()
                d.key = key
                d.value =value
                d.section = section
                d.description = description
                d.tipo_section = tipo_section
                d.tipo = tipo
                d.active = active
                d.visible = visible
                d.date = datetime.now()
                d.persist()
                messageInfo(msg=_("MODULO O OPZIONE MODIFICATO attivato o disattivato"))
                dialog.destroy()
                return
            elif d[1] == "registro":
                operazione = d[2].strip()+".registro"
                registro_da_assegnare = d[3]
                from promogest.dao.Setting import Setting
                a = Setting().getRecord(id=operazione)
                if a:
                    b = Setting().select(value=registro_da_assegnare)
                    if b:
                        a.value = registro_da_assegnare
                        a.persist()
                        messageInfo(msg=_("REGISTRO NUMERAZIONE MODIFICATO\n\nRIAVVIARE"))
                        dialog.destroy()
                        return True
                    else:
                        messageInfo(msg=_("REGISTRO DA ASSEGNARE NON TROVATO O CORRETTO\n\n RIPROVARE"))
                        return False
                else:
                    messageInfo(msg=_("OPERAZIONE NON CORRETTA E NON TROVATA\n\nRIPROVARE"))
                    return False
        else:
            sets = SetConf().select(key="install_code",section="Master")
            if sets:
                sets[0].delete()
            if codice:
                k = SetConf()
                k.key = "install_code"
                k.value =str(hashlib.sha224(codice+orda(codice)).hexdigest())
                k.section = "Master"
                k.description = "codice identificativo della propria installazione"
                k.tipo_section = "General"
                k.tipo = "ONE"
                k.active = True
                k.date = datetime.now()
                k.persist()
                messageInfo(msg=_("ATTIVAZIONE EFFETTUATA, RIAVVIARE IL PROMOGEST"))
        dialog.destroy()