Example #1
0
    def on_main_iconview_select(self, icon_view, model=None):

        selected = icon_view.get_selected_items()
        if len(selected) == 0:
            return
        i = selected[0]
        selection = self.iconview_listore[i][0]

        if selection == 3:
            if not hasAction(actionID=2):
                return
            from promogest.ui.anagDocumenti.AnagraficaDocumenti import AnagraficaDocumenti
            anag = AnagraficaDocumenti(aziendaStr=self.aziendaStr)
            showAnagrafica(self.getTopLevel(), anag, mainClass=self)
            icon_view.unselect_all()
            return
        elif selection == 4:
            if not hasAction(actionID=15):
                return
            from promogest.modules.PrimaNota.ui.AnagraficaPrimaNota import AnagraficaPrimaNota
            anag = AnagraficaPrimaNota(aziendaStr=self.aziendaStr)
            showAnagrafica(self.getTopLevel(), anag, mainClass=self)
            icon_view.unselect_all()
            return
        elif selection == 5:
            if posso("PR"):
                from promogest.ui.anagPromemoria.AnagraficaPromemoria import AnagraficaPromemoria
                anag = AnagraficaPromemoria(self.aziendaStr)
                showAnagrafica(self.getTopLevel(), anag, mainClass=self)
                icon_view.unselect_all()
                return
            else:
                fencemsg()
        elif selection == 10: #gestione commessa
            #if posso("GC"):
            from promogest.modules.GestioneCommesse.ui.AnagraficaCommesse import AnagraficaCommesse
            anag = AnagraficaCommesse(aziendaStr=self.aziendaStr)
            showAnagrafica(self.getTopLevel(), anag, mainClass=self)
            icon_view.unselect_all()
            return

        else:
            i = selected[0][0]
            selection = self.iconview_listore[i][0]
            module = self.iconview_listore[i][3]

            if self.currentFrame is not None:
                self.main_hbox.remove(self.currentFrame)
                self.currentFrame.destroy()
                self.currentFrame = None
            if module.VIEW_TYPE[0] == 'anagrafica_diretta':
                anag = module.getApplication()
                showAnagrafica(self.getTopLevel(), anag, mainClass=self)
                icon_view.unselect_all()
                return
            elif module.VIEW_TYPE[0] == 'frame':
                frame = module.getApplication()
                self.currentFrame = frame.getTopLevel()
        self.main_notebook.set_current_page(0)
        self._refresh()
Example #2
0
 def on_articoli_button_clicked(self, toggleButton):
     if not hasAction(actionID=2):
         return
     if toggleButton.get_property('active') is False:
         return
     from promogest.ui.anagArti.AnagraficaArticoli import AnagraficaArticoli
     anag = AnagraficaArticoli(aziendaStr=Environment.azienda)
     showAnagrafica(self.getTopLevel(), anag, toggleButton, mainClass=self)
Example #3
0
 def on_module_button_clicked(self, button):
     label = button.get_label()
     for mk in self.anagrafiche_modules.iteritems():
         module = mk[1]['module']
         if label == module.VIEW_TYPE[1]:
             #chiave di tutto il richiamo di passaggio alla classe in module.py che poi fa la vera istanza"
             anag = module.getApplication()
             showAnagrafica(self.getTopLevel(), anag, button=None, mainClass=self)
Example #4
0
    def on_documenti_button_clicked(self, toggleButton):
        if toggleButton.get_property('active') is False:
            return
        if not hasAction(actionID=2):return
        from promogest.ui.anagDocumenti.AnagraficaDocumenti import AnagraficaDocumenti
        anag = AnagraficaDocumenti(aziendaStr=self.aziendaStr)

        showAnagrafica(self.mainWindow, anag, toggleButton)
Example #5
0
 def on_aliquote_iva_button_clicked(self, toggleButton):
     if toggleButton.get_property('active') is False:
         return
     if not hasAction(actionID=6):
         toggleButton.set_active(False)
         return
     from AnagraficaAliquoteIva import AnagraficaAliquoteIva
     anag = AnagraficaAliquoteIva()
     showAnagrafica(self.getTopLevel(), anag, toggleButton, mainClass=self)
Example #6
0
 def on_imballaggi_button_clicked(self, toggleButton):
     if toggleButton.get_property('active') is False:
         return
     if not hasAction(actionID=6):
         toggleButton.set_active(False)
         return
     from AnagraficaImballaggi import AnagraficaImballaggi
     anag = AnagraficaImballaggi()
     showAnagrafica(self.getTopLevel(), anag, toggleButton, mainClass=self)
Example #7
0
 def on_categorie_contatti_button_clicked(self, toggleButton):
     if toggleButton.get_property('active') is False:
         return
     if not hasAction(actionID=6):
         toggleButton.set_active(False)
         return
     from promogest.ui.Contatti.AnagraficaCategorieContatti import AnagraficaCategorieContatti
     anag = AnagraficaCategorieContatti()
     showAnagrafica(self.getTopLevel(), anag, toggleButton, mainClass=self)
Example #8
0
    def on_stadio_commessa_button_toggled(self, toggleButton):

        if toggleButton.get_property('active') is False:
            return
        if not hasAction(actionID=6):
            toggleButton.set_active(False)
            return
#        if posso("GC"):
#        messageInfo(msg="""RICORDIAMO CHE QUESTO MODULO E' ANCORA IN FASE DI TEST """)
        from promogest.modules.GestioneCommesse.ui.AnagraficaStadioCommessa import AnagraficaStadioCommessa
        anag = AnagraficaStadioCommessa()
        showAnagrafica(self.getTopLevel(), anag, toggleButton, mainClass=self)
Example #9
0
 def on_agenti_button_clicked(self, toggleButton):
     if toggleButton.get_property('active') is False:
         return
     if not hasAction(actionID=6):
         toggleButton.set_active(False)
         return
     if posso("AG"):
         from promogest.ui.anagAgenti.AnagraficaAgenti import AnagraficaAgenti
         anag = AnagraficaAgenti(aziendaStr=self.aziendaStr)
         showAnagrafica(self.getTopLevel(), anag, toggleButton, mainClass=self)
     else:
         fencemsg()
         toggleButton.set_active(False)
Example #10
0
 def on_ruoli_azioni_button_toggled(self, toggleButton):
     if toggleButton.get_property('active') is False:
         return
     if not hasAction(actionID=6):
         toggleButton.set_active(False)
         return
     if posso("RA"):
         from promogest.modules.RuoliAzioni.ui.ManageRoleAction import ManageRuoloAzioni
         anag = ManageRuoloAzioni()
         showAnagrafica(self.getTopLevel(), anag, toggleButton, mainClass=self)
     else:
         fencemsg()
         toggleButton.set_property('active', False)
Example #11
0
 def on_apri_anag_secondarie_toggle_toggled(self, toggleButton):
     if toggleButton.get_property('active') is False:
         return
     from promogest.ui.AnagraficaSecondaria import AnagraficaSecondarie
     if not findIdFromCombobox(self.anag_minori_combobox):
         obligatoryField(None,
                         self.anag_minori_combobox,
                         msg=_('Campo obbligatorio !\n\nTipo AnagraficaSecondaria'))
         toggleButton.set_active(False)
     model = self.anag_minori_combobox.get_model()
     iterator = self.anag_minori_combobox.get_active_iter()
     if iterator is not None:
         dao = model.get_value(iterator, 0)
     anag = AnagraficaSecondarie(aziendaStr=self.aziendaStr, daoRole=dao)
     showAnagrafica(self.getTopLevel(), anag, toggleButton, mainClass=self)
Example #12
0
    def on_main_iconview_right_select(self, icon_view, model=None):
        selected = icon_view.get_selected_items()
        if len(selected) == 0:
            return
        i = selected[0][0]
#        selection = model[i][0]
        module = model[i][3]

        if self.currentFrame is not None:
            self.main_hbox.remove(self.currentFrame)
            self.currentFrame.destroy()
            self.currentFrame = None
        if module.VIEW_TYPE[0] == 'anagrafica_diretta':
            anag = module.getApplication()
            showAnagrafica(self.getTopLevel(), anag, mainClass=self)
            icon_view.unselect_all()
            return
        elif module.VIEW_TYPE[0] == 'frame':
            frame = module.getApplication()
            self.currentFrame = frame.getTopLevel()
##            icon_view.unselect_all()
        self._refresh()
Example #13
0
 def on_client_sincro_db_activate(self, widget):
     if posso("SD") and Environment.conf.SincroDB.tipo == "client":
         from promogest.modules.SincroDB.ui.SincroDB import SincroDB
         anag = SincroDB()
         showAnagrafica(self.getTopLevel(), anag)
Example #14
0
    def on_pan_active_clicked(self, button):
#        if not hasAction(actionID=14):return
        configuraWindow = PanUi(self)
        showAnagrafica(self.getTopLevel(), configuraWindow)
Example #15
0
 def on_dati_azienda_activate(self, widget):
     from AnagraficaAziende import AnagraficaAziende
     anag =AnagraficaAziende(self)
     showAnagrafica(self.getTopLevel(), anag)
Example #16
0
    def on_configurazione_menu_activate(self, widget):
        if not hasAction(actionID=14):return
        configuraWindow = ConfiguraWindow(self)
#        configuraWindow = SetConfUI(self)
        showAnagrafica(self.getTopLevel(), configuraWindow)
Example #17
0
 def on_ricerca_lotto_menuitem_activate(self, button):
     from promogest.ui.RicercaLottiWindow import RicercaLottiWindow
     anag = RicercaLottiWindow(self)
     showAnagrafica(self.getTopLevel(), anag)
Example #18
0
 def on_vettori_button_clicked(self, toggleButton):
     if toggleButton.get_property('active') is False:
         return
     from promogest.ui.anagVettori.AnagraficaVettori import AnagraficaVettori
     anag = AnagraficaVettori(aziendaStr=self.aziendaStr)
     showAnagrafica(self.getTopLevel(), anag, toggleButton, mainClass=self)
Example #19
0
    def show(self):
        """ show the main windows program
        """
        # documenti_image = self.documenti_image.get_image()
        model = self.iconview_listore
        model.append([3, _("Documenti\n(Fatture,DDT\nPreventivi)"),
                           self.documenti_image.get_pixbuf(), None])
        model.append([4, _("Prima Nota"),
                           self.primanota_image.get_pixbuf(), None])
        model.append([5, _("Promemoria"),
                           self.promemoria_image.get_pixbuf(), None])
        model.append([10, _("Gestione\nCommesse"),
                            self.gest_commesse_image.get_pixbuf(), None])

        # right vertical icon list  adding modules
        # model_right = gtk.ListStore(int, str, gtk.gdk.Pixbuf, object)
        ind = 6
        for mod in self.anagrafiche_dirette_modules:
            currModule = self.anagrafiche_dirette_modules[mod]
            from promogest.preEnv import shop
            if shop \
                and currModule["module"].VIEW_TYPE[1] == "Vendita Dettaglio":
                anag = currModule["module"].getApplication()
                from promogest.modules.VenditaDettaglio.ui.AnagraficaVenditaDettaglio import showAnagrafica
                showAnagrafica(self.getTopLevel(), anag, mainClass=self)
                # icon_view.unselect_all()
                return
            pbuf = GDK_PIXBUF_NEW_FROM_FILE(currModule['guiDir'] \
                                    + currModule['module'].VIEW_TYPE[2])
            row = (ind, currModule['module'].VIEW_TYPE[1],
                                            pbuf, currModule['module'])
            model.append(row)
            ind += 1
        for mod in self.frame_modules:
            currModule = self.frame_modules[mod]
            pbuf = GDK_PIXBUF_NEW_FROM_FILE(currModule['guiDir'] \
                                    + currModule['module'].VIEW_TYPE[2])
            row = (ind, currModule['module'].VIEW_TYPE[1],
                                            pbuf, currModule['module'])
            model.append(row)
            ind += 1

        self.main_iconview.set_model(model)
        self.main_iconview.set_text_column(1)
        self.main_iconview.set_pixbuf_column(2)
        self.main_iconview.set_columns(1)
        self.main_iconview.set_item_width(65)
        self.main_iconview.set_size_request(95, -1)

        if self.currentFrame is None:
            self._refresh()
        self.setModulesButtons()
        self.placeWindow(self.main_window)
        self.main_window.show()
        self.on_button_refresh_clicked()

        fillComboboxRole(self.anag_minori_combobox, noAdmin=True)

        def update_timer():
            leggiRevisioni()
            if Environment.rev_locale < Environment.rev_remota:
                self.active_img.set_from_file("gui/active_off.png")
            else:
                self.active_img.set_from_file("gui/active_on.png")
            return True
        # glib.timeout_add_seconds(600, update_timer)
        update_timer()

        def pulizia_lottotemp():
            ltemp = setconf("Documenti", "lotto_temp")
            if not ltemp:
                return
            from promogest.dao.NumeroLottoTemp import NumeroLottoTemp
            from promogest.dao.RigaMovimentoFornitura import RigaMovimentoFornitura
            from promogest.dao.Fornitura import Fornitura
            print "Avvio pulizia lotti temp..."
            lt = NumeroLottoTemp().select(batchSize=None)
            n = len(lt)
            g = 0
            for l in lt:
                print "RESIDUI DA ELABORARE", n-lt.index(l)
                rmf =  RigaMovimentoFornitura().select(idRigaMovimentoVendita=l.id_riga_movimento_vendita_temp)
                if not rmf:
                    #cerchiamo una fornitura precisa
                    daoForn = Fornitura().select(idArticolo=l.rigamovventemp.id_articolo,
                                            numeroLotto = l.lotto_temp,
                                            batchSize = None)

                    if daoForn:
                        a = RigaMovimentoFornitura()
                        a.id_articolo = l.rigamovventemp.id_articolo
                        a.id_riga_movimento_vendita = l.id_riga_movimento_vendita_temp
                        a.id_fornitura = daoForn[0].id
                        Environment.params["session"].add(a)
                        Environment.params["session"].delete(l)
                        g += 1
                        if g == 2000:
                            Environment.params["session"].commit()
                            g = 0
                else:
                    Environment.params["session"].delete(l)
            Environment.params["session"].commit()