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()
def __init__(self, parent=0, *args, **kwargs): super(PeriodByViewWidget, self).__init__(parent=parent, *args, **kwargs) self.parent = parent self.title = FPageTitle(_(u"Periodic report")) 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.current_period = FLabel( self.format_period(self.on_date.text(), self.end_date.text())) vbox = QVBoxLayout() # Grid gridbox = QGridLayout() gridbox.addWidget(FormLabel(u"Date debut"), 0, 0) gridbox.addWidget(self.on_date, 0, 1) gridbox.addWidget(FormLabel(u"Date fin"), 1, 0) gridbox.addWidget(self.end_date, 1, 1) gridbox.addWidget(self.Button, 1, 2) gridbox.setColumnStretch(3, 1) gridbox.addWidget(self.current_period, 1, 4) self.table = By_periodTableWidget(parent=self) vbox.addWidget(self.title) vbox.addLayout(gridbox) vbox.addWidget(self.table) self.setLayout(vbox)
def __init__(self, table_p, parent, provid_clt=None, type_=None, refund=None, *args, **kwargs): QDialog.__init__(self, parent, *args, **kwargs) self.type_ = type_ self.refund = refund self.parent = parent self.table_p = table_p self.provid_clt = provid_clt self.new = True if self.refund: self.new = False self.last_r = self.refund self.type_ = refund.type_ self.refund_date_field = FormatDate(self.refund.date) self.refund_date_field.setEnabled(False) self.title = u"Modification de {} {}".format(self.refund.type_, self.refund.invoice.client) self.succes_msg = u"{} a été bien mise à jour".format( self.refund.type_) self.amount = refund.amount self.provid_clt = refund.provider_client else: self.refund_date_field = FormatDate(QDate.currentDate()) self.succes_msg = u"Client a été bien enregistré" self.title = u"Création d'un nouvel client" self.amount = "" self.refund = Refund() self.last_r = Refund.select().where( Refund.provider_client == provid_clt).order_by(Refund.date.desc()).get() self.setWindowTitle(self.title) self.amount_field = IntLineEdit(unicode(self.amount)) vbox = QVBoxLayout() self.last_remaining = self.last_r.refund_remaing() # try: # self.last_r.refund_remaing() # self.remaining = self.last_r.remaining # except Exception as e: # self # print("last_r except ", e) # self.last_r = None # self.close() formbox = QFormLayout() formbox.addRow(FormLabel("Client :"), FormLabel(self.provid_clt.name)) formbox.addRow(FormLabel("Dette restante :"), FormLabel(str(formatted_number(self.last_remaining)))) formbox.addRow(FormLabel(u"Date : *"), self.refund_date_field) formbox.addRow(FormLabel(u"Montant : *"), self.amount_field) butt = ButtonSave(u"Enregistrer") butt.clicked.connect(self.save_edit) formbox.addRow("", butt) # formbox.addRow("", "Le client {} n'est pas endetté") vbox.addLayout(formbox) self.setLayout(vbox)
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)
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)
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 __init__(self, table_p, parent, type_=None, payment=None, *args, **kwargs): QDialog.__init__(self, parent, *args, **kwargs) self.type_ = type_ self.payment = payment self.parent = parent self.table_p = table_p if self.payment: self.new = False self.type_ = payment.type_ self.payment_date_field = FormatDate(self.payment.date) self.payment_date_field.setEnabled(False) self.title = u"Modification de {} {}".format(self.payment.type_, self.payment.libelle) self.succes_msg = u"{} a été bien mise à jour".format( self.payment.type_) if self.type_ == Payment.CREDIT: amount = payment.credit elif self.type_ == Payment.DEBIT: amount = payment.debit else: self.new = True amount = "" self.payment_date_field = FormatDate(QDate.currentDate()) self.succes_msg = u"Client a été bien enregistré" self.title = u"Création d'un nouvel client" self.payment = Payment() self.setWindowTitle(self.title) self.amount_field = IntLineEdit(unicode(amount)) self.libelle_field = QTextEdit(self.payment.libelle) vbox = QVBoxLayout() formbox = QFormLayout() formbox.addRow(FormLabel(u"Date : *"), self.payment_date_field) formbox.addRow(FormLabel(u"Libelle :"), self.libelle_field) formbox.addRow(FormLabel(u"Montant : *"), self.amount_field) butt = ButtonSave(u"Enregistrer") butt.clicked.connect(self.save_edit) formbox.addRow("", butt) vbox.addLayout(formbox) self.setLayout(vbox)
def __init__(self, parent=0, *args, **kwargs): super(BuyViewWidget, self).__init__(parent=parent, *args, **kwargs) self.parentWidget().setWindowTitle(Config.APP_NAME + u" Arrivage d'article") self.parent = parent vbox = QVBoxLayout() hbox = QHBoxLayout() editbox = QGridLayout() self.date = FormatDate(QDate.currentDate()) self.name_client = LineEdit() self.search_field = LineEdit() self.search_field.setPlaceholderText("Rechercher un article") self.search_field.setMaximumHeight(40) self.search_field.textChanged.connect(self.finder) # self.search_field.setFixedWidth(200) self.add_prod = Button(u"+ &Article") self.add_prod.clicked.connect(self.add_product) self.add_prod.setFixedWidth(80) # self.add_prod.setFixedHeight(20) self.add_prod.setStyleSheet("Text-align:botton") self.add_prod.setToolTip("Ajouter un nouvel article") self.table_buy = BuyTableWidget(parent=self) self.table_resultat = ResultatTableWidget(parent=self) self.table_info = InfoTableWidget(parent=self) editbox.addWidget(self.add_prod, 0, 1) editbox.addWidget(FormLabel(u"Date d'achat:"), 0, 4) editbox.addWidget(self.date, 0, 5) editbox.setColumnStretch(3, 3) splitter = QSplitter(Qt.Horizontal) splitter_left = QSplitter(Qt.Vertical) splitter_down = QSplitter(Qt.Vertical) splitter_left.addWidget(self.search_field) splitter_left.addWidget(self.table_resultat) splitter_down.resize(35, 20) splitter_down.addWidget(self.table_info) splitter_rigth = QSplitter(Qt.Vertical) splitter_rigth.addWidget(self.table_buy) splitter_rigth.resize(800, 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)
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)
def __init__(self, table_p, parent, scoop=None, member=None, *args, **kwargs): FWidget.__init__(self, parent, *args, **kwargs) self.table_p = table_p self.member = member self.scoop = scoop self.parent = parent full_name = "" self.ddn_field = FormatDate(QDate(QDate.currentDate())) addres = "" nationality = "" phone = "" if self.member: self.new = False full_name = self.member.full_name mddn = self.member.ddn if mddn: day, month, year = mddn.split("/") ddn = datetime.strptime(mddn, '%d/%m/%Y') self.ddn_field.setDate(QDate(ddn)) addres = self.member.addres nationality = self.member.nationality phone = str(self.member.phone or "") self.title = u"Modification de {}".format(self.member) self.succes_msg = u"{} a été bien mise à jour".format(self.member) else: self.new = True self.succes_msg = u"Client a été bien enregistré" self.title = u"Ajout nouveau membre" self.member = CooperativeMember() self.setWindowTitle(self.title) vbox = QVBoxLayout() # vbox.addWidget(FPageTitle(u"Utilisateur: %s " % self.member.name)) self.full_name_field = LineEdit(full_name) self.sex_list = CooperativeMember.SEX.items() # Combobox widget self.sex_box = QComboBox() for index, value in enumerate(self.sex_list): # form = self.sex_list[index] self.sex_box.addItem("{}".format(value[1].upper()), value[0]) if self.member.sex == value[0]: self.sex_box.setCurrentIndex(index) # print("DE", ddn) # self.ddn_field.setDate(ddn) # self.ddn_field = QDateEdit(QDate(ddn)) self.addres_field = QTextEdit(addres) self.nationality_field = LineEdit(nationality) self.phone_field = IntLineEdit(phone) self.phone_field.setInputMask("## ## ## ##") self.poste_list = get_postes() self.poste_box = QComboBox() for index, value in enumerate(self.poste_list): self.poste_box.addItem( "{}".format(self.poste_list.get(value).upper()), value) if self.member.poste == value: print(value) self.poste_box.setCurrentIndex(index) formbox = QFormLayout() formbox.addRow(FormLabel(u"Nom complet : *"), self.full_name_field) formbox.addRow(FormLabel(u"Sexe *:"), self.sex_box) formbox.addRow(FormLabel(u"Date de naissance *:"), self.ddn_field) formbox.addRow(FormLabel(u"Poste occupé *:"), self.poste_box) formbox.addRow(FormLabel(u"Nationalité *:"), self.nationality_field) formbox.addRow(FormLabel(u"Téléphone :"), self.phone_field) formbox.addRow(FormLabel(u"Adresse :"), self.addres_field) butt = Button(u"Enregistrer") butt.clicked.connect(self.save_edit) formbox.addRow("", butt) vbox.addLayout(formbox) self.setLayout(vbox)
def __init__(self, table_p, report, parent, *args, **kwargs): QDialog.__init__(self, parent, *args, **kwargs) self.setWindowTitle(u"Modification") self.table_p = table_p self.rpt = report self.parent = parent self.out_op = True if self.rpt.type_ == Report.E: self.out_op = False self.selling_price_field = IntLineEdit(unicode(self.rpt.selling_price)) self.cost_buying_field = IntLineEdit(unicode(self.rpt.cost_buying)) self.qty_field = IntLineEdit(unicode(self.rpt.qty)) self.date_field = FormatDate(QDate(self.rpt.date)) self.date_field.setEnabled(False) butt = Button(u"Mise à jour") butt.clicked.connect(self.edit_report) cancel_but = Button(u"Annuler") cancel_but.clicked.connect(self.cancel) # Combobox widget i = 0 self.liste_type = [Report.E, Report.S] self.box_type = QComboBox() self.box_type.setEnabled(False) for index in xrange(0, len(self.liste_type)): ty = self.liste_type[index] if ty == self.rpt.type_: i = index sentence = u"%(ty)s" % {'ty': ty} self.box_type.addItem(sentence, ty) self.box_type.setCurrentIndex(i) # Combobox widget # self.liste_store = Store.order_by(desc(Store.id)).all() # self.box_mag = QComboBox() # for index in xrange(0, len(self.liste_store)): # op = self.liste_store[index] # sentence = u"%(name)s" % {'name': op.name} # self.box_mag.addItem(sentence, QVariant(op.id)) # Combobox widget self.liste_product = Product.all() self.box_prod_field = QComboBox() self.box_prod_field.setEnabled(False) for index in xrange(0, len(self.liste_product)): prod = self.liste_product[index] if prod.name == self.rpt.product.name: i = index sentence = u"%(name)s" % {'name': prod.name} self.box_prod_field.addItem(sentence, prod.id) self.box_prod_field.setCurrentIndex(i) vbox = QVBoxLayout() formbox = QFormLayout() # editbox.addWidget(FormLabel((_(u"Store"))), 0, 1) # editbox.addWidget(self.box_mag, 1, 1) formbox.addRow(FormLabel(u"Type"), FormLabel(self.rpt.type_)) formbox.addRow(FormLabel(u"Désignation"), self.box_prod_field) formbox.addRow(FormLabel(u"Quantité"), self.qty_field) formbox.addRow(FormLabel("Prix d'achat"), self.cost_buying_field) formbox.addRow(FormLabel("Prix vente"), self.selling_price_field) formbox.addRow(FormLabel(u"Date"), self.date_field) formbox.addRow(butt, cancel_but) vbox.addLayout(formbox) self.setLayout(vbox)
def __init__(self, parent=0, *args, **kwargs): super(RegistrationViewWidget, self).__init__(parent=parent, *args, **kwargs) self.parent = parent self.parentWidget().set_window_title("FORMULAIRE D’IMMATRICULATION") self.title = FLabel("<h3>FORMULAIRE D’IMMATRICULATION</h3>") self.office = Office.select().where(Office.id == 1).get() self.created_date_field = FormatDate(QDate.currentDate()) self.created_date_field.setMaximumWidth(130) # self.created_date_field.setInputMask('##/##/####') self.rue_field = IntLineEdit() self.porte_field = IntLineEdit() self.tel_field = IntLineEdit() self.tel_field.setInputMask('## ## ## ##') self.tel2_field = IntLineEdit() self.tel2_field.setInputMask('## ## ## ##') self.bp_field = IntLineEdit() self.email_field = LineEdit() self.denomination_field = LineEdit() self.commercial_name_field = LineEdit() self.declaration_date_field = FormatDate(QDate.currentDate()) self.declaration_date_field.setMaximumWidth(130) self.amount_capital_social_initial = FLabel() self.amount_part_social_field = IntLineEdit() self.apports_numeraire_field = IntLineEdit() self.apports_numeraire_field.textChanged.connect(self.cal_total) self.apports_nature_field = IntLineEdit() self.apports_nature_field.textChanged.connect(self.cal_total) self.apports_industrie_field = IntLineEdit() self.apports_industrie_field.textChanged.connect(self.cal_total) self.duree_statutaire_field = IntLineEdit() self.duree_statutaire_field.setMaximumWidth(80) self.spinneret_box = QComboBox() self.spinneret_box.setMaximumWidth(800) self.activites_box = QComboBox() self.activites_box.setMaximumWidth(800) self.activites_box.currentIndexChanged.connect(self.sp_change_select) self.activities_list = get_activities() for index, value in enumerate(self.activities_list): self.activites_box.addItem( "{}".format(self.activities_list.get(value).upper()), value) # if self.store and self.store.name == op.name: # self.box_store.setCurrentIndex(index) self.formes_box = QComboBox() self.formes_box.setMaximumWidth(800) self.formes_list = get_formes() for index, value in enumerate(self.formes_list): self.formes_box.addItem( "{}".format(self.formes_list.get(value).upper()), value) self.commune_list = entity_children(self.office.slug_cercle).items() self.commune_box = ExtendedComboBox() for index, value in enumerate(self.commune_list): self.commune_box.addItem("{}".format(value[1].upper()), value[0]) # self.commune_box.addItems(self.commune_list) self.commune_box.setToolTip("commune") self.commune_box.currentIndexChanged.connect(self.c_change_select) # self.vfq_list = self.get_vfq_list() self.vfq_box = ExtendedComboBox() self.vfq_list = self.get_vfq_list() for index, value in enumerate(self.vfq_list): self.vfq_box.addItem("{}".format(self.vfq_list.get(value).upper()), value) self.vfq_box.setToolTip("vfq") formbox = QFormLayout() formbox.addRow(FLabel(DATE_DEMANTE), self.declaration_date_field) formbox.addRow(FLabel("1. " + DENOMINATION_S_SC), self.denomination_field) formbox.addRow(FLabel("2. " + NOM_COMMERCIAL), self.commercial_name_field) formbox.addRow(FLabel("3. " + DATE_CREATION_SC), self.created_date_field) formbox.addRow(FLabel("4. " + ACTIVITES_E), self.activites_box) formbox.addRow(FLabel("5. " + FILIERE), self.spinneret_box) formbox.addRow(FLabel("6. " + FORME_SC), self.formes_box) # Capital Social Initial capital_formbox = QFormLayout() capital_formbox.addRow(FLabel("7.1. " + MONTANT_PART_S), self.amount_part_social_field) capital_formbox.addRow(FLabel("7.2. " + MONTANT_APPORTS_NUM), self.apports_numeraire_field) capital_formbox.addRow(FLabel("7.3. " + MONTANT_APPORTS_NAT), self.apports_nature_field) capital_formbox.addRow(FLabel("7.4. " + MONTANT_APPORTS_INDU), self.apports_industrie_field) self.capitalSGroupBox = QGroupBox("7. " + MONTANT_CAPITAL_SI) self.capitalSGroupBox.setLayout(capital_formbox) self.capitalSGroupBox.setStyleSheet(CSS) # self.capitalSGroupBox.setMaximumWidth(1300) # Adresse du siège social self.vline = QFrame() self.vline.setFrameShape(QFrame.VLine) self.vline.setFrameShadow(QFrame.Sunken) self.addresGroupBox = QGroupBox("8. " + ADRESSE_SS) self.addresGroupBox.setStyleSheet(CSS) addres_gribox = QGridLayout() addres_gribox.addWidget(FRLabel(CERCLE), 0, 0) addres_gribox.addWidget(FLabel(self.office.cercle_name()), 0, 1) addres_gribox.addWidget(FRLabel(COMMUNE), 1, 0) addres_gribox.addWidget(self.commune_box, 1, 1) # addres_gribox.addWidget(self.vline, 0, 3, 2, 5) addres_gribox.addWidget(FRLabel(VFQ), 2, 0) addres_gribox.addWidget(self.vfq_box, 2, 1) addres_gribox.addWidget(FRLabel(RUE), 0, 2) addres_gribox.addWidget(self.rue_field, 0, 3) addres_gribox.addWidget(FRLabel(PORTE), 1, 2) addres_gribox.addWidget(self.porte_field, 1, 3) addres_gribox.addWidget(FRLabel(BP), 0, 4) addres_gribox.addWidget(self.bp_field, 0, 5) addres_gribox.addWidget(FRLabel(EMAIL), 1, 4) addres_gribox.addWidget(self.email_field, 1, 5) addres_gribox.addWidget(FRLabel(TEL), 2, 2) addres_gribox.addWidget(self.tel_field, 2, 3) addres_gribox.addWidget(FRLabel(TEL2), 2, 4) addres_gribox.addWidget(self.tel2_field, 2, 5) # addres_gribox.setColumnStretch(6, 5) self.addresGroupBox.setLayout(addres_gribox) # self.addresGroupBox.setMaximumWidth(1300) # Durée statutaire de la société coopérative duree_fbox = QFormLayout() duree_fbox.addRow(FLabel("9. " + DUREE_STATUTAIRE_SC), self.duree_statutaire_field) butt = Button_save(SAVE) butt.clicked.connect(self.save_and_goto_manager) butt_and_continous = Button_save(SAVE_AND_CONTINNUES) butt_and_continous.clicked.connect(self.save_and_goto_add_member) butt_and_continous.setMaximumWidth(300) duree_fbox.addRow(FLabel(""), FLabel("")) duree_fbox.addRow(butt, butt_and_continous) vbox = QVBoxLayout() vbox.addLayout(formbox) vbox.addWidget(self.capitalSGroupBox) vbox.addWidget(self.addresGroupBox) vbox.addLayout(duree_fbox) self.setLayout(vbox)
def __init__(self, product="", parent=0, *args, **kwargs): super(InvoiceViewWidget, self).__init__(parent=parent, *args, **kwargs) self.parentWidget().setWindowTitle(Config.APP_NAME + u" Ventes") self.parent = parent vbox = QVBoxLayout() # hbox = QHBoxLayout(self) editbox = QGridLayout() try: next_number = int(Invoice.select().order_by( Invoice.number.desc()).get().number) + 1 except: next_number = 1 self.num_invoice = IntLineEdit(str(next_number)) self.num_invoice.setToolTip(u"Le numéro") self.num_invoice.setMaximumSize( 40, self.num_invoice.maximumSize().height()) self.invoice_date = FormatDate(QDate.currentDate()) # self.name_client_field = LineEdit() 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_new = "" 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.add_clt_btt = BttSmall(u"+") self.add_clt_btt.clicked.connect(self.add_clt) self.add_clt_btt.setFixedWidth(50) # Combobox widget for add store self.liste_type_invoice = [ Invoice.TYPE_FACT, Invoice.TYPE_BON, Invoice.TYPE_PROF ] self.box_type_inv = QComboBox() for index in range(0, len(self.liste_type_invoice)): op = self.liste_type_invoice[index] sentence = u"%(name)s" % {'name': op} self.box_type_inv.addItem(sentence, op) self.search_field = LineEdit() self.search_field.setPlaceholderText("Rechercher un article") self.search_field.textChanged.connect(self.finder) # self.search_field.setFixedWidth(250) self.search_field.setMaximumHeight(40) self.table_invoice = InvoiceTableWidget(parent=self) self.table_resultat = ResultatTableWidget(parent=self) self.table_info = InfoTableWidget(parent=self) self.table_resultat.refresh_("") editbox.addWidget(self.box_type_inv, 0, 2) editbox.addWidget(self.num_invoice, 0, 3) editbox.addWidget(FLabel(u"Doit :"), 1, 2) editbox.addWidget(self.name_client_field, 1, 3) # editbox.addWidget(self.add_clt_btt, 1, 4) editbox.addWidget(self.invoice_date, 0, 6) editbox.setColumnStretch(0, 1) editbox.setColumnStretch(5, 1) splitter = QSplitter(Qt.Horizontal) splitter_left = QSplitter(Qt.Vertical) splitter_left.addWidget(self.search_field) splitter_left.addWidget(self.table_resultat) # splitter_down.resize(15, 20) splitter_down = QSplitter(Qt.Vertical) splitter_down.addWidget(self.table_info) splitter_rigth = QSplitter(Qt.Vertical) # splitter_rigth.setLayout(editbox) splitter_rigth.addWidget(self.table_invoice) splitter_rigth.resize(800, 900) splitter_left.addWidget(splitter_down) splitter.addWidget(splitter_left) splitter.addWidget(splitter_rigth) vbox.addLayout(editbox) vbox.addWidget(splitter) self.setLayout(vbox)