コード例 #1
0
ファイル: data_helper.py プロジェクト: Ciwara/GCiss
def warning_of_prod():
    """"""
    l = []
    for store in Store.all():
        for prod in Product.all():
            report = last_report_store_prod(store.name, prod.name)
            try:
                if report.remaining < Config.nb_warning:
                    l.append(report)
            except AttributeError:
                pass
    return l
コード例 #2
0
def warning_of_prod():
    """"""
    list_w = []
    for store in Store.all():
        for prod in Product.all():
            report = last_report_store_prod(store.name, prod.name)
            try:
                if report.remaining < Config.nb_warning:
                    list_w.append(report)
            except AttributeError:
                pass
    return list_w
コード例 #3
0
ファイル: stock_input.py プロジェクト: fadiga/mstock
    def __init__(self, product="", parent=0, *args, **kwargs):
        super(StockInputWidget, self).__init__(parent=parent, *args, **kwargs)
        title = u"   ENTREE STOCK"
        self.parentWidget().setWindowTitle(Config.NAME_ORGA +
                                           title)
        Config.logging.info(title)
        self.parent = parent

        vbox = QVBoxLayout(self)
        hbox = QHBoxLayout(self)
        editbox = QGridLayout()

        self.date = FormatDate(QDate.currentDate())

        # Combobox widget for add store
        self.liste_store = Store.all()

        self.box_mag = QComboBox()
        for index in range(0, len(self.liste_store)):
            op = self.liste_store[index]
            sentence = u"%(name)s" % {'name': op.name}
            self.box_mag.addItem(sentence, op.id)

        self.search_field = QLineEdit()
        self.search_field.setPlaceholderText("Rechercher un article")
        self.search_field.setMaximumSize(200,
                                         self.search_field.maximumSize().height())
        self.search_field.textChanged.connect(self.finder)

        self.add_prod = Button(u"+ &Article")
        self.add_prod.clicked.connect(self.add_product)

        self.vline = QFrame()
        self.vline.setFrameShape(QFrame.VLine)
        self.vline.setFrameShadow(QFrame.Sunken)

        self.table_resultat = ResultatTableWidget(parent=self)
        self.table_info = InfoTableWidget(parent=self)
        self.table_in = InputTableWidget(parent=self)

        self.table_resultat.refresh_()
        editbox.addWidget(self.search_field, 0, 0)

        editbox.addWidget(self.vline, 0, 2, 1, 1)

        editbox.addWidget(FormLabel(u"Magasin:"), 0, 4)
        editbox.addWidget(self.box_mag, 0, 5)
        editbox.addWidget(FormLabel(u"Date d'entrée:"), 0, 6)
        editbox.addWidget(self.date, 0, 7)

        editbox.setColumnStretch(3, 3)
        splitter = QSplitter(Qt.Horizontal)
        # splitter.setFrameShape(QFrame.StyledPanel)

        splitter_left = QSplitter(Qt.Vertical)
        # splitter_left.addWidget(FBoxTitle(u"Les products"))
        splitter_left.addWidget(self.table_resultat)

        splitter_down = QSplitter(Qt.Vertical)
        splitter_down.resize(15, 20)
        splitter_down.addWidget(self.table_info)
        splitter_down.addWidget(self.add_prod)

        splitter_rigth = QSplitter(Qt.Vertical)
        # splitter_rigth.addWidget(FBoxTitle(u"Les products achatés"))
        splitter_rigth.addWidget(self.table_in)
        splitter_rigth.resize(500, 900)

        splitter_left.addWidget(splitter_down)
        splitter.addWidget(splitter_left)
        splitter.addWidget(splitter_rigth)

        hbox.addWidget(splitter)
        vbox.addLayout(editbox)
        vbox.addLayout(hbox)
        self.setLayout(vbox)
コード例 #4
0
ファイル: stock_output.py プロジェクト: fadiga/mstock
    def __init__(self, product="", parent=0, *args, **kwargs):
        super(StockOutputWidget, self).__init__(parent=parent, *args, **kwargs)
        self.parentWidget().setWindowTitle(
            Config.NAME_ORGA + u"      SORTIE STOCK ")
        self.parent = parent

        vbox = QVBoxLayout(self)
        hbox = QHBoxLayout(self)
        editbox = QGridLayout()

        self.date_out = FormatDate(QDate.currentDate())

        # Combobox widget for add store
        self.liste_store = Store.all()

        self.box_store = QComboBox()
        for index in xrange(0, len(self.liste_store)):
            op = self.liste_store[index]
            sentence = u"{name}".format(name=op.name)
            self.box_store.addItem(sentence, op.id)

        self.search_field = QLineEdit()
        self.search_field.setPlaceholderText("Rechercher un article")
        self.search_field.setMaximumSize(
            200, self.search_field.maximumSize().height())
        self.search_field.textChanged.connect(self.finder)

        self.vline = QFrame()
        self.vline.setFrameShape(QFrame.VLine)
        self.vline.setFrameShadow(QFrame.Sunken)

        self.table_resultat = ResultatTableWidget(parent=self)
        self.table_info = InfoTableWidget(parent=self)
        self.table_out = InproductTableWidget(parent=self)
        self.box_store.connect(self.box_store,
                               SIGNAL("currentIndexChanged(int)"),
                               self.table_out.changed_value)

        self.table_resultat.refresh_("")
        # editbox.addWidget(FormLabel(u"Recherche:"), 0, 0)
        editbox.addWidget(self.search_field, 0, 0)

        editbox.addWidget(self.vline, 0, 2, 1, 1)

        editbox.addWidget(FormLabel(u"Magasin:"), 0, 4)
        editbox.addWidget(self.box_store, 0, 5)
        editbox.addWidget(FormLabel(u"Date d'achat:"), 0, 6)
        editbox.addWidget(self.date_out, 0, 7)

        editbox.setColumnStretch(3, 3)
        splitter = QSplitter(Qt.Horizontal)

        splitter_left = QSplitter(Qt.Vertical)
        # splitter_left.addWidget(FBoxTitle(u"Les products"))
        splitter_left.addWidget(self.table_resultat)

        splitter_down = QSplitter(Qt.Vertical)
        splitter_down.resize(15, 20)
        splitter_down.addWidget(self.table_info)

        splitter_rigth = QSplitter(Qt.Vertical)
        # splitter_rigth.addWidget(FBoxTitle(u"Les products achatés"))
        splitter_rigth.addWidget(self.table_out)
        splitter_rigth.resize(500, 900)

        splitter_left.addWidget(splitter_down)
        splitter.addWidget(splitter_left)
        splitter.addWidget(splitter_rigth)

        hbox.addWidget(splitter)
        vbox.addLayout(editbox)
        vbox.addLayout(hbox)
        self.setLayout(vbox)
コード例 #5
0
ファイル: stores.py プロジェクト: lokaimoma/PythonWebScrapper
def index():
    stores = Store.all()

    return render_template('stores/index.html', stores=stores)