def _refresh(self):
     self.denominazione_entry.set_text(self.dao.denominazione or '')
     self.spese_entry.set_text(str(self.dao.spese or 0))
     self.codice_entry.set_text(self.dao.codice or '')
     findComboboxRowFromStr(self.tipo_combobox, self.dao.tipo, 0)
     findComboboxRowFromId(self.id_aliquota_iva_ccb.combobox,
                           self.dao.id_aliquota_iva)
    def draw(self, cplx=False):
        """
        FIXME
        """
        # Colonne della Treeview per il filtro
        treeview = self._anagrafica.anagrafica_filter_treeview
        rendererSx = gtk.CellRendererText()
        rendererDx = gtk.CellRendererText()
        rendererDx.set_property('xalign', 1)

        column = gtk.TreeViewColumn('Listino', rendererSx, text=1)
        column.set_sizing(GTK_COLUMN_GROWN_ONLY)
        column.set_clickable(True)
        column.connect("clicked", self._changeOrderBy, (Listino, 'Listino.denominazione'))
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(100)
        treeview.append_column(column)

        column = gtk.TreeViewColumn('Codice articolo', rendererSx, text=2)
        column.set_sizing(GTK_COLUMN_GROWN_ONLY)
        column.set_clickable(True)
        column.connect("clicked", self._changeOrderBy, (Articolo, 'Articolo.codice'))
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(100)
        treeview.append_column(column)

        column = gtk.TreeViewColumn('Articolo', rendererSx, text=3)
        column.set_sizing(GTK_COLUMN_GROWN_ONLY)
        column.set_clickable(True)
        column.connect("clicked", self._changeOrderBy, (Articolo, 'Articolo.denominazione'))
        column.set_resizable(True)
        column.set_expand(True)
        column.set_min_width(200)
        treeview.append_column(column)

        column = gtk.TreeViewColumn('Data variazione', rendererSx, text=4)
        column.set_sizing(GTK_COLUMN_GROWN_ONLY)
        column.set_clickable(True)
        column.connect("clicked", self._changeOrderBy, (None,'data_listino_articolo'))
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(100)
        treeview.append_column(column)

        column = gtk.TreeViewColumn('Prezzo dettaglio', rendererDx, text=5)
        column.set_sizing(GTK_COLUMN_GROWN_ONLY)
        column.set_clickable(True)
        column.connect("clicked", self._changeOrderBy, (None, 'prezzo_dettaglio'))
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(100)
        treeview.append_column(column)

        column = gtk.TreeViewColumn('Prezzo ingrosso', rendererDx, text=6)
        column.set_sizing(GTK_COLUMN_GROWN_ONLY)
        column.set_clickable(True)
        column.connect("clicked", self._changeOrderBy, (None, 'prezzo_ingrosso'))
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(100)
        treeview.append_column(column)

        column = gtk.TreeViewColumn('Ultimo costo', rendererDx, text=7)
        column.set_sizing(GTK_COLUMN_GROWN_ONLY)
        column.set_clickable(True)
        column.connect("clicked", self._changeOrderBy, (None, 'prezzo_dettaglio'))
        column.set_resizable(True)
        column.set_expand(False)
        column.set_min_width(100)
        treeview.append_column(column)


        if posso("PW"):
            drawPromoWearExpand1(self)
        else:
            self._treeViewModel = gtk.ListStore(object, str, str, str, str, str, str, str)
        self._anagrafica.anagrafica_filter_treeview.set_model(self._treeViewModel)
        self.isComplexPriceList=None
        if self._anagrafica._idListino:
            self.isComplexPriceList = ListinoComplessoListino().select(idListinoComplesso = self._anagrafica._idListino, batchSize=None)
        if self.isComplexPriceList:
            self.sotto_listini_label.set_sensitive(True)
            self.id_sotto_listino_filter_combobox.set_sensitive(True)
            fillComboboxListiniComplessi(self.id_sotto_listino_filter_combobox,
                                        idListinoComplesso = self._anagrafica._idListino,filter=True)

        fillComboboxListini(self.id_listino_filter_combobox, True)
        fillComboboxFamiglieArticoli(self.id_famiglia_articolo_filter_combobox, True)
        fillComboboxCategorieArticoli(self.id_categoria_articolo_filter_combobox, True)

        if self._anagrafica._articoloFissato:
            self.id_articolo_filter.setId(self._anagrafica._idArticolo)
            self.id_articolo_filter.set_sensitive(False)
            if not (self._anagrafica._listinoFissato):
                column = self._anagrafica.anagrafica_filter_treeview.get_column(1)
                column.set_property('visible', False)
                column = self._anagrafica.anagrafica_filter_treeview.get_column(2)
                column.set_property('visible', False)
                if posso("PW"):
                    drawPromoWearExpand2(self)
        if self._anagrafica._listinoFissato:
            findComboboxRowFromId(self.id_listino_filter_combobox, self._anagrafica._idListino)
            Environment.listinoFissato = self._anagrafica._idListino
            if not (self._anagrafica._articoloFissato):
                column = self._anagrafica.anagrafica_filter_treeview.get_column(0)
                column.set_property('visible', False)
        self.clear()
Example #3
0
    def _refresh(self):
        try:
            self.zeri_in_riga_check.set_active(int(setconf("Stampa", "zeri_in_riga")))
        except:
            self.zeri_in_riga_check.set_active(0)
        try:
            self.zeri_in_totali_check.set_active(int(setconf("Stampa", "zeri_in_totali")))
        except:
            self.zeri_in_totali_check.set_active(0)
        try:
            self.feed_check.set_active(int(setconf("Feed", "feed")))
        except:
            self.feed_check.set_active(1)
        try:
            findComboboxRowFromId(self.timer_combobox, str(setconf("General", "updates_timeout")))
        except:
            findComboboxRowFromId(self.timer_combobox, '300')

        try:
            curr = setconf("Valuta", "valuta_curr")
            if curr =="€":
                self.euro_radio.set_active(1)
            elif curr =="$":
                self.dollaro_radio.set_active(1)
            elif curr =="£":
                self.sterlina_radio.set_active(1)
            elif curr =="CHF":
                self.francosvizzero_radio.set_active(1)
        except:
            self.euro_radio.set_active(1)
        try:
            self.mercatino_check.set_active(int(setconf("General", "gestione_totali_mercatino")))
        except:
            self.mercatino_check.set_active(0)

        try:
            self.gestione_lotti_check.set_active(int(setconf("General", "gestione_lotti")))
        except:
            self.gestione_lotti_check.set_active(0)


        try:
            self.vettore_codice_upper_check.set_active(int(setconf("Vettori", "vettore_codice_upper")))
        except:
            self.vettore_codice_upper_check.set_active(1)

        self.vettore_struttura_codice_entry.set_text(str(setconf("Vettori", "vettore_struttura_codice")))
        self.altezza_logo_entry.set_text(str(setconf("Documenti", "altezza_logo")))
        self.larghezza_logo_entry.set_text(str(setconf("Documenti", "larghezza_logo")))
        self.combo_column_entry.set_text(str(setconf("Numbers", "combo_column")))
        self.decimals_entry.set_text(str(setconf("Numbers","decimals")))
        self.separatore_entry.set_text(str(setconf("Documenti","separatore_numerazione") or ""))
        self.batch_size_entry.set_text(str(setconf("Numbers","batch_size")))
        self.documenti_setup_page._refresh()
        self.articoli_setup_page._refresh()
        self.clienti_setup_page._refresh()
        self.fornitori_setup_page._refresh()
        self.primanota_setup_page._refresh()
        self.label_setup_page._refresh()
        if posso("VD"):
            self.vendita_dettaglio_setup_page._refresh()