Ejemplo n.º 1
0
    def __init__(self, parent=0, *args, **kwargs):
        super(DashbordViewWidget, self).__init__(parent=parent, *args, **kwargs)

        self.parentWidget().setWindowTitle(Config.APP_NAME + "    TABLEAU DE BORD")

        self.parent = parent

        vbox = QVBoxLayout()
        table_invoice = QVBoxLayout()
        table_buying = QVBoxLayout()

        self.search_field = LineEdit()
        self.search_field.setPlaceholderText("Rechercher")
        self.search_field.setMaximumSize(500, self.search_field.maximumSize().height())
        self.search_field.textChanged.connect(self.finder)

        self.title = FPageTitle("TABLEAU DE BORD")

        self.title_buying = FBoxTitle("L'arivages ")
        self.table_buying = BuyTableWidget(parent=self)
        table_buying.addWidget(self.title_buying)
        table_buying.addWidget(self.table_buying)

        self.title_invoice = FBoxTitle("Les Factures")
        self.table_invoice = InvoiceTableWidget(parent=self)
        table_invoice.addWidget(self.search_field)
        table_invoice.addWidget(self.table_invoice)

        tab_widget = tabbox((table_invoice, "Factures"), (table_buying, "Arivages "))

        vbox.addWidget(self.title)
        vbox.addWidget(tab_widget)
        self.setLayout(vbox)
Ejemplo n.º 2
0
    def __init__(self, parent, scoop=None, *args, **kwargs):
        super(CoopSocietyManager, self).__init__(
            parent=parent, *args, **kwargs)
        self.title = FPageTitle(
            "Gestion de coopérative {}-<strong>{}</strong>".format(scoop, scoop.immatricule))
        vbox = QVBoxLayout()
        self.scoop = scoop
        self.dmd = self.scoop.demande()
        self.setWindowTitle(self.scoop.denomination)

        info_general = QVBoxLayout()
        self.info_general = InfoManageWidget(parent=self)
        info_general.addWidget(self.info_general)

        member_table = QVBoxLayout()
        self.member_table = MemberManagerWidget(parent=self)
        # member_table.addLayout(gridbox)
        member_table.addWidget(self.member_table)

        tab_widget = tabbox((info_general, u"Info. générale"),
                            (member_table, u"Membres"))

        vbox.addWidget(self.title)
        vbox.addWidget(tab_widget)
        self.setLayout(vbox)
Ejemplo n.º 3
0
    def __init__(self, parent=0, *args, **kwargs):
        super(DashbordViewWidget, self).__init__(
            parent=parent, *args, **kwargs)

        self.parentWidget().set_window_title("TABLEAU DE BORD")

        self.parent = parent
        vbox = QVBoxLayout()
        # self.resize(self.wc, self.hc)
        self.title = FPageTitle("TABLEAU DE BORD")

        self.title_alert = FBoxTitle(u"Les alertes")
        jinja = Environment(loader=FileSystemLoader('static'))
        template = jinja.get_template('chart.html')

        cc_list = CooperativeCompanie.select().order_by('-start_date')
        dataset = {
            "wc": self.width(),
            "hc": self.height(),
            "toal_scoop": cc_list.count(),
            "sc_coop_ca": cc_list.where(CooperativeCompanie.forme == "b").count(),
            "sc_scoops": cc_list.where(CooperativeCompanie.forme == "a").count(),
            "union": cc_list.where(CooperativeCompanie.forme == "bv").count(),
            "federation": cc_list.where(CooperativeCompanie.forme == "bf").count(),
            "confederation": cc_list.where(CooperativeCompanie.forme == "bc").count(),
        }

        graph1 = template.render(base_url=ROOT_DIR, data=dataset)

        template2 = jinja.get_template('table.html')
        table_html = template2.render(base_url=ROOT_DIR, dataset=dataset)

        web_graphic = QWebView()
        web_graphic.setHtml(graph1)
        tab_graphic = QVBoxLayout()
        # tab_graphic.setMargin(20)
        tab_graphic.addWidget(web_graphic)

        web_table = QWebView()
        web_table.setHtml(table_html)
        tab_table = QVBoxLayout()
        tab_table.addWidget(web_table)

        tab_widget = tabbox((tab_graphic, u"Graphique"), (tab_table, u"Tableau"))
        # tab_widget1 = tabbox((tab_table, u"Tableau"))

        vbox.addWidget(self.title)
        vbox.addWidget(tab_widget)
        # vbox.addWidget(tab_widget1)
        self.setLayout(vbox)
Ejemplo n.º 4
0
    def __init__(self, parent=0, *args, **kwargs):
        super(DashbordViewWidget, self).__init__(
            parent=parent, *args, **kwargs)

        self.parentWidget().setWindowTitle(
            Config.APP_NAME + u"    TABLEAU DE BORD")

        self.parent = parent
        vbox = QVBoxLayout()
        table_invoice = QVBoxLayout()
        table_alert = QVBoxLayout()
        table_mouvement = QVBoxLayout()

        self.search_field = LineEdit()
        self.search_field.setToolTip("Rechercher un produit")
        self.search_field.setMaximumSize(
            500, self.search_field.maximumSize().height())
        self.search_field.textChanged.connect(self.finder)

        self.title = FPageTitle("TABLEAU DE BORD")

        self.title_alert = FBoxTitle(u"Les alertes ")
        self.table_alert = AlertTableWidget(parent=self)
        # table_alert.addWidget(self.title_alert)
        table_alert.addWidget(self.table_alert)

        self.title_invoice = FBoxTitle(u"Les stocks actual")
        self.table_invoice = InvoiceTableWidget(parent=self)
        table_invoice.addWidget(self.search_field)
        table_invoice.addWidget(self.table_invoice)

        self.table_mouvement = GReportTableWidget(parent=self)
        self.title_mouvement = FBoxTitle(
            show_date(self.table_mouvement.today, time=False))
        # table_invoice.addWidget(self.title_invoice)
        # table_mouvement.addWidget(self.title_mouvement)
        table_mouvement.addWidget(self.table_mouvement)
        tab_widget = tabbox((table_mouvement, u"Les Mouvements"),
                            (table_invoice, u"Les Factures"),
                            (table_alert, u"Alertes sur les produits "))

        vbox.addWidget(self.title)
        vbox.addWidget(tab_widget)
        self.setLayout(vbox)
Ejemplo n.º 5
0
    def __init__(self, parent=0, *args, **kwargs):
        super(AdminViewWidget, self).__init__(parent=parent, *args, **kwargs)

        self.parent = parent

        self.parentWidget().setWindowTitle(
            Config.APP_NAME + u"    ADMINISTRATION")

        editbox = QGridLayout()
        table_config = QVBoxLayout()
        self.table_config = OrganizationTableWidget(parent=self)
        table_config.addLayout(editbox)
        table_config.addWidget(self.table_config)

        self.bttrestor = Button(_(u"Restaurer"))
        self.bttrestor.clicked.connect(self.restorseleted)
        self.bttrestor.setEnabled(False)
        self.bttempty = Button(_(u"Vide"))
        self.bttempty.clicked.connect(self.deletedseleted)
        self.bttempty.setEnabled(False)
        # Grid
        gridbox = QGridLayout()
        history_table = QVBoxLayout()

        self.history_table = TrashTableWidget(parent=self)
        history_table.addLayout(gridbox)
        history_table.addWidget(self.history_table)

        table_login = QVBoxLayout()
        self.table_login = LoginManageWidget(parent=self)
        table_login.addLayout(gridbox)
        table_login.addWidget(self.table_login)

        tab_widget = tabbox((table_config, _(u"Gestion de l'organisation")),
                            (history_table, _(u"Historique")),
                            (table_login, _(u"Gestion d'Utilisateurs")),
                            )

        vbox = QVBoxLayout()
        vbox.addWidget(tab_widget)
        self.setLayout(vbox)
Ejemplo n.º 6
0
    def __init__(self, parent=0, *args, **kwargs):
        super(DashbordViewWidget, self).__init__(parent=parent,
                                                 *args,
                                                 **kwargs)

        self.parentWidget().setWindowTitle(Config.APP_NAME +
                                           u"    TABLEAU DE BORD")

        self.parent = parent

        vbox = QVBoxLayout()
        table_invoice = QVBoxLayout()
        table_buying = QVBoxLayout()

        self.search_field = LineEdit()
        self.search_field.setPlaceholderText(
            "Taper un nom client ou num. facture")
        self.search_field.setMaximumSize(
            500,
            self.search_field.maximumSize().height())
        self.search_field.textChanged.connect(self.finder)

        self.title = FPageTitle("TABLEAU DE BORD")

        self.title_buying = FBoxTitle(u"L'arivages ")
        self.table_buying = BuyTableWidget(parent=self)
        table_buying.addWidget(self.title_buying)
        table_buying.addWidget(self.table_buying)

        self.title_invoice = FBoxTitle(u"Les Factures")
        self.table_invoice = InvoiceTableWidget(parent=self)
        table_invoice.addWidget(self.search_field)
        table_invoice.addWidget(self.table_invoice)

        tab_widget = tabbox((table_invoice, u"Factures"),
                            (table_buying, u"Arivages "))

        vbox.addWidget(self.title)
        vbox.addWidget(tab_widget)
        self.setLayout(vbox)