def __init__(self, parent=0, *args, **kwargs):
        super(CooperativeSocietyViewWidget, self).__init__(parent=parent,
                                                           *args,
                                                           **kwargs)

        self.parentWidget().set_window_title("SCOOP")

        self.parent = parent
        self.search_field = LineEdit()
        self.search_field.setPlaceholderText("Rechercher une coopérative")
        self.search_field.setMinimumSize(600, 80)
        self.search_field.textChanged.connect(self.finder)

        self.btt_xlsx_export = BttExportXLSX("")
        self.btt_xlsx_export.clicked.connect(self.export_xlsx)
        self.btt_xlsx_export.setMaximumWidth(40)
        self.btt_xlsx_export.setEnabled(False)
        self.string_list = []
        self.title_field = FPageTitle("Gestion des Sociétés coopératives")

        self.table = MemberTableWidget(parent=self)

        editbox = QGridLayout()
        editbox.addWidget(self.search_field, 1, 0)
        editbox.setColumnStretch(1, 1)
        editbox.addWidget(self.btt_xlsx_export, 1, 2)

        vbox = QVBoxLayout()
        vbox.addWidget(self.title_field)
        vbox.addLayout(editbox)
        vbox.addWidget(self.table)
        self.setLayout(vbox)
Пример #2
0
    def __init__(self, parent=0, *args, **kwargs):
        super(ApricotsViewWidget, self).__init__(parent=parent,
                                                 *args,
                                                 **kwargs)
        self.parentWidget().setWindowTitle(Config.APP_NAME + u"    La Caise")

        self.parent = parent

        tablebox = QVBoxLayout()
        gridbox = QGridLayout()
        self.title = "La caise"
        tablebox.addWidget(FPageTitle(self.title))
        self.date_ = FormatDate(QDate.currentDate())
        self.btt_export = BttExportXLSX(u"Exporter")
        self.btt_export.setEnabled(False)
        self.btt_export.clicked.connect(self.export_xls)

        self.table_op = ApricotsTableWidget(parent=self)
        tablebox.addWidget(self.table_op)
        # self.date_.setFont(QFont("Courier New", 10, True))
        self.date_.dateChanged.connect(self.table_op.refresh_)

        gridbox.addWidget(self.date_, 0, 0)
        gridbox.addWidget(self.btt_export, 0, 2)
        gridbox.setColumnStretch(1, 5)

        vbox = QVBoxLayout()
        vbox.addLayout(gridbox)
        vbox.addLayout(tablebox)
        self.setLayout(vbox)
Пример #3
0
class ApricotsViewWidget(FWidget):
    def __init__(self, parent=0, *args, **kwargs):
        super(ApricotsViewWidget, self).__init__(parent=parent,
                                                 *args,
                                                 **kwargs)
        self.parentWidget().setWindowTitle(Config.APP_NAME + u"    La Caise")

        self.parent = parent

        tablebox = QVBoxLayout()
        gridbox = QGridLayout()
        self.title = "La caise"
        tablebox.addWidget(FPageTitle(self.title))
        self.date_ = FormatDate(QDate.currentDate())
        self.btt_export = BttExportXLSX(u"Exporter")
        self.btt_export.setEnabled(False)
        self.btt_export.clicked.connect(self.export_xls)

        self.table_op = ApricotsTableWidget(parent=self)
        tablebox.addWidget(self.table_op)
        # self.date_.setFont(QFont("Courier New", 10, True))
        self.date_.dateChanged.connect(self.table_op.refresh_)

        gridbox.addWidget(self.date_, 0, 0)
        gridbox.addWidget(self.btt_export, 0, 2)
        gridbox.setColumnStretch(1, 5)

        vbox = QVBoxLayout()
        vbox.addLayout(gridbox)
        vbox.addLayout(tablebox)
        self.setLayout(vbox)

    def export_xls(self):
        from Common.exports_xlsx import export_dynamic_data
        dict_data = {
            'file_name': "caise",
            'headers': self.table_op.hheaders,
            'data': self.table_op.get_table_items(),
            "extend_rows": [
                (3, self.table_op.amount_ht),
            ],
            'sheet': self.title,
            'title': self.title,
            'format_money': [
                "C:C",
                "D:D",
            ],
            'widths': self.table_op.stretch_columns,
            "date": self.date_.text()
        }
        export_dynamic_data(dict_data)
Пример #4
0
    def __init__(self, parent=0, *args, **kwargs):
        super(InventoryViewWidget, self).__init__(parent=parent,
                                                  *args,
                                                  **kwargs)

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

        self.parent = parent

        self.title = u"Inventaire"

        self.on_date = FormatDate(QDate(date.today().year, 1, 1))
        self.end_date = FormatDate(QDate.currentDate())
        self.button = Button(u"Ok")
        self.button.clicked.connect(self.rapport_filter)
        self.btt_export = BttExportXLSX(u"Exporter")
        self.btt_export.clicked.connect(self.export_xls)

        self.invent_table = InventaireTableWidget(parent=self)
        # Grid
        gridbox = QGridLayout()
        gridbox.addWidget(FormLabel(u"Date debut"), 0, 1)
        gridbox.addWidget(self.on_date, 0, 2)
        gridbox.addWidget(FormLabel(u"Date fin"), 1, 1)
        gridbox.addWidget(self.end_date, 1, 2)
        gridbox.addWidget(self.button, 1, 3)
        gridbox.addWidget(self.btt_export, 1, 6)
        gridbox.setColumnStretch(4, 5)
        vbox = QVBoxLayout()
        vbox.addWidget(FPageTitle(self.title))
        vbox.addLayout(gridbox)
        vbox.addWidget(self.invent_table)
        self.setLayout(vbox)
        self.refresh()
Пример #5
0
    def __init__(self, parent=0, *args, **kwargs):

        super(StatViewWidget, self).__init__(
            parent=parent, *args, **kwargs)
        FPeriodHolder.__init__(self, *args, **kwargs)

        self.title = "Les Activités"
        self.parentWidget().setWindowTitle(
            "{} {}".format(Config.APP_NAME, self.title))
        self.parent = parent

        self.table_rpt = ReportTableWidget(
            parent=self, main_date=self.main_date)

        self.btt_export = BttExportXLSX(u"Exporter")
        self.btt_export.clicked.connect(self.export_xls)

        gridbox = QtGui.QGridLayout()
        gridbox.addWidget(self.btt_export, 0, 3)
        gridbox.setColumnStretch(0, 2)

        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(FPageTitle(self.title))
        vbox.addLayout(gridbox)
        vbox.addWidget(self.periods_bar)
        vbox.addWidget(self.table_rpt)
        self.setLayout(vbox)
Пример #6
0
    def __init__(self, table_p, buy="", parent=0, *args, **kwargs):
        # super(BuyShowViewWidget, self).__init__(parent=parent,
        #                                         *args, **kwargs)
        QDialog.__init__(self, parent, *args, **kwargs)
        self.parentWidget().setWindowTitle(Config.APP_NAME +
                                           u"  CONSULTATION DES ACHAT")

        self.parent = parent
        self.buy = buy
        self.table_p = table_p
        self.title = "Arivage"

        vbox = QVBoxLayout()
        vbox.addWidget(FPageTitle(self.title))

        self.table_show = ShowBuyTableWidget(parent=self)

        editbox = QGridLayout()
        self.btt_export = BttExportXLSX("")
        self.btt_export.clicked.connect(self.export_xls)
        self.button_dl = DeletedBtt(u"Annuler la facture")
        self.button_dl.released.connect(self.cancellation)

        editbox.addWidget(FLabel(u"<b>Achat N°: </b>%s" % self.buy.id), 0, 0)
        editbox.addWidget(FLabel(u"<b>Par : </b> %s " % self.buy.owner), 1, 0)
        editbox.addWidget(
            FLabel(u"<b>Date : </b>%s" % (show_date(self.buy.date))), 1, 3)
        editbox.addWidget(self.button_dl, 0, 4)
        editbox.addWidget(self.btt_export, 1, 4)

        vbox.addLayout(editbox)
        vbox.addWidget(self.table_show)
        self.setLayout(vbox)
Пример #7
0
    def __init__(self, parent=0, *args, **kwargs):

        super(PaymentViewWidget, self).__init__(parent=parent, *args, **kwargs)
        FPeriodHolder.__init__(self, *args, **kwargs)

        self.parentWidget().setWindowTitle(Config.APP_NAME + u"   Movements")
        self.parent = parent

        self.title = u"Movements"

        self.on_date = FormatDate(
            QDate(date.today().year,
                  date.today().month, 1))
        self.end_date = FormatDate(QDate.currentDate())
        self.now = datetime.now().strftime("%x")
        self.soldeField = FormLabel("0")
        self.label_balance = FormLabel(u"Solde au {} ".format(self.now))
        balanceBox = QGridLayout()
        balanceBox.addWidget(self.label_balance, 0, 2)
        balanceBox.addWidget(self.soldeField, 0, 3)
        balanceBox.setColumnStretch(0, 1)

        self.table = RapportTableWidget(parent=self)
        self.button = Button(u"Ok")
        self.button.clicked.connect(self.table.refresh_)

        self.btt_export = BttExportXLSX(u"Exporter")
        self.btt_export.clicked.connect(self.export_xls)
        self.add_btt = Button("Créditer")
        self.add_btt.setIcon(
            QIcon(u"{img_media}{img}".format(img_media=Config.img_media,
                                             img="in.png")))
        self.add_btt.clicked.connect(self.add_payment)
        self.sub_btt = Button("Débiter")
        self.sub_btt.setIcon(
            QIcon(u"{img_media}{img}".format(img_media=Config.img_media,
                                             img="out.png")))
        self.sub_btt.clicked.connect(self.sub_payment)

        editbox = QGridLayout()
        editbox.addWidget(FormLabel(u"Date debut"), 0, 1)
        editbox.addWidget(self.on_date, 0, 2)
        editbox.addWidget(FormLabel(u"Date fin"), 1, 1)
        editbox.addWidget(self.end_date, 1, 2)
        editbox.addWidget(self.button, 1, 3)

        editbox.addWidget(self.sub_btt, 1, 5)
        editbox.addWidget(self.add_btt, 1, 6)
        editbox.addWidget(self.btt_export, 1, 7)
        editbox.setColumnStretch(4, 2)
        vbox = QVBoxLayout()
        vbox.addWidget(FPageTitle(self.title))
        vbox.addLayout(editbox)
        vbox.addWidget(self.table)
        vbox.addLayout(balanceBox)
        self.setLayout(vbox)
Пример #8
0
    def __init__(self, parent=0, *args, **kwargs):

        super(ProvidersViewWidget, self).__init__(parent=parent,
                                                  *args,
                                                  **kwargs)

        self.parent = parent

        self.title = u"Movements"

        self.on_date = FormatDate(QDate(date.today().year, 1, 1))
        self.end_date = FormatDate(QDate.currentDate())
        # self.now = datetime.now().strftime("%x")
        self.soldeField = FormLabel("{}".format(device_amount(0)))
        balanceBox = QGridLayout()
        balanceBox.addWidget(self.soldeField, 0, 3)
        balanceBox.setColumnStretch(0, 1)

        self.string_list = [""] + [
            "{},{}".format(clt.name, clt.phone)
            for clt in ProviderOrClient.select().where(
                ProviderOrClient.type_ == ProviderOrClient.CLT).order_by(
                    ProviderOrClient.name.desc())
        ]

        self.name_client_field = ExtendedComboBox()
        self.name_client_field.addItems(self.string_list)
        self.name_client_field.setMaximumSize(
            200,
            self.name_client_field.maximumSize().height())
        self.name_client_field.setToolTip("Nom, numero du client")

        self.table = RapportTableWidget(parent=self)
        self.button = Button(u"Ok")
        self.button.clicked.connect(self.refresh_prov_clt)

        self.btt_export = BttExportXLSX(u"Exporter")
        self.btt_export.clicked.connect(self.export_xls)

        editbox = QGridLayout()
        editbox.addWidget(FormLabel(u"Date debut"), 0, 1)
        editbox.addWidget(self.on_date, 0, 2)
        editbox.addWidget(FormLabel(u"Date fin"), 1, 1)
        editbox.addWidget(self.end_date, 1, 2)
        editbox.addWidget(self.name_client_field, 0, 3)
        editbox.addWidget(self.button, 1, 3)

        editbox.addWidget(self.btt_export, 1, 7)
        editbox.setColumnStretch(4, 2)
        vbox = QVBoxLayout()
        vbox.addWidget(FPageTitle(self.title))
        vbox.addLayout(editbox)
        vbox.addWidget(self.table)
        vbox.addLayout(balanceBox)
        self.setLayout(vbox)
Пример #9
0
    def __init__(self, parent=0, *args, **kwargs):
        super(OrderViewWidget, self).__init__(parent=parent, *args, **kwargs)

        self.order_table = OrederTableWidget(parent=self)
        self.parentWidget().setWindowTitle("{} {}".format(
            Config.APP_NAME, "COMMANDE"))

        self.title = FPageTitle(u"Faire une Commande")

        self.com_date = FormatDate(QDate.currentDate())
        vbox = QVBoxLayout()

        self.export_xls_btt = BttExportXLSX(u"Exporter")
        self.connect(self.export_xls_btt, SIGNAL('clicked()'),
                     self.export_xls_order)

        # self.save_order_btt = ButtonSave(u"enregistre")
        # self.connect(self.save_order_btt, SIGNAL('clicked()'),
        #              self.save_order)

        self.restor_order_btt = DeletedBtt(u"vider")
        self.connect(self.restor_order_btt, SIGNAL('clicked()'),
                     self.remove_save)

        # Grid
        gridbox = QGridLayout()
        gridbox.addWidget(FormLabel(u"Date"), 0, 0)
        gridbox.addWidget(self.com_date, 0, 1)
        gridbox.setColumnStretch(1, 5)
        gridbox.addWidget(self.restor_order_btt, 2, 2)
        # gridbox.addWidget(self.save_order_btt, 2, 3)
        gridbox.addWidget(self.export_xls_btt, 2, 4)
        vbox.addWidget(self.title)
        vbox.addLayout(gridbox)
        vbox.addWidget(self.order_table)
        self.setLayout(vbox)