Beispiel #1
0
 def is_valide(self):
     flag = True
     if (check_is_empty(self.name_field) or
             check_is_empty(self.category_field)
             # or check_is_empty(self.number_parts_box_field)
             ):
         flag = False
     return flag
Beispiel #2
0
 def is_valide(self):
     if check_is_empty(self.full_name_field):
         return False
     if check_is_empty(self.ddn_field):
         return False
     if check_is_empty(self.nationality_field):
         return False
     if check_is_empty(self.phone_field):
         return False
     return True
Beispiel #3
0
 def is_valide(self):
     # print("isactive")
     if (check_is_empty(self.username_field)):
         return False
     if (check_is_empty(self.password_field)):
         return False
     if (self.new and check_is_empty(self.password_field_v)):
         return False
     if (not self.check_password_is_valide()):
         return False
     return True
Beispiel #4
0
    def changed_value(self, refresh=False):
        """ Calcule les Resultat """
        self.mtt_ht = 0
        # self.button.setEnabled(False)
        for row_num in xrange(0, self.data.__len__()):
            product = Product.get(
                Product.name == unicode(self.item(row_num, 0).text()))
            last_report = product.last_report
            last_price = product.last_price()
            qtremaining = last_report.remaining
            selling_price = last_price
            invoice_date = unicode(self.parent.invoice_date.text())

            qtsaisi = is_int(self.cellWidget(row_num, 1).text())
            pusaisi = is_int(self.cellWidget(row_num, 2).text())

            if check_is_empty(self.parent.num_invoice):
                return
            if check_is_empty(self.parent.name_client_field.lineEdit()):
                return
            # if check_field(self.parent.invoice_date,
            #                "Le {} est Inférieure à la date de la dernière rapport (<b>{}</b>)".format(date_to_datetime(invoice_date), last_report.date), (last_report.date > date_to_datetime(invoice_date))):
            #     return
            if (pusaisi and check_is_empty(self.cellWidget(row_num, 1))):
                return
            if (pusaisi and check_is_empty(self.cellWidget(row_num, 2))):
                return
            if check_field(
                    self.cellWidget(row_num, 1),
                    u"<b>{}</b> est supérieur à la quantité restante (<b>{}</b>)"
                    .format(qtsaisi, qtremaining), qtremaining < qtsaisi):
                return
            if check_field(
                    self.cellWidget(row_num, 2),
                    u"<b>{}</b> est inférieure au prix minimum de vente<b> {} CFA</b>"
                    .format(pusaisi, selling_price), pusaisi < selling_price):
                print("E")
                # return

            montant = (qtsaisi * pusaisi)
            self.mtt_ht += montant
            self.setItem(row_num, 3, TotalsWidget(formatted_number(montant)))
            self._update_data(row_num, [qtsaisi, pusaisi, self.mtt_ht])
        self.setItem(row_num + 1, 3,
                     TotalsWidget(formatted_number(self.mtt_ht)))
        typ = self.parent.liste_type_invoice[
            self.parent.box_type_inv.currentIndex()]
        self.paid_amount_field.setText(
            str(self.mtt_ht) if typ == Invoice.TYPE_BON else "0")
        self.button.setEnabled(True)
Beispiel #5
0
    def changed_value(self, refresh=False):
        """ Calcule les Resultat """
        self.mtt_ht = 0
        # self.button.setEnabled(False)
        for row_num in xrange(0, self.data.__len__()):
            product = Product.get(
                Product.name == unicode(self.item(row_num, 0).text()))
            last_report = product.last_report
            last_price = product.last_price()
            qtremaining = last_report.remaining
            selling_price = last_price
            invoice_date = unicode(self.parent.invoice_date.text())

            qtsaisi = is_int(self.cellWidget(row_num, 1).text())
            pusaisi = is_int(self.cellWidget(row_num, 2).text())

            if check_is_empty(self.parent.num_invoice):
                return
            if check_is_empty(self.parent.name_client_field.lineEdit()):
                return
            # if check_field(self.parent.invoice_date,
            #                "Le {} est Inférieure à la date de la dernière rapport (<b>{}</b>)".format(date_to_datetime(invoice_date), last_report.date), (last_report.date > date_to_datetime(invoice_date))):
            #     return
            if (pusaisi and check_is_empty(self.cellWidget(row_num, 1))):
                return
            if (pusaisi and check_is_empty(self.cellWidget(row_num, 2))):
                return
            if check_field(self.cellWidget(row_num, 1),
                           u"<b>{}</b> est supérieur à la quantité restante (<b>{}</b>)".format(
                    qtsaisi, qtremaining), qtremaining < qtsaisi):
                return
            if check_field(self.cellWidget(row_num, 2),
                           u"<b>{}</b> est inférieure au prix minimum de vente<b> {} CFA</b>".format(
                    pusaisi, selling_price), pusaisi < selling_price):
                print("E")
                # return

            montant = (qtsaisi * pusaisi)
            self.mtt_ht += montant
            self.setItem(row_num, 3, TotalsWidget(formatted_number(montant)))
            self._update_data(row_num, [qtsaisi, pusaisi, self.mtt_ht])
        self.setItem(
            row_num + 1, 3, TotalsWidget(formatted_number(self.mtt_ht)))
        typ = self.parent.liste_type_invoice[
            self.parent.box_type_inv.currentIndex()]
        self.paid_amount_field.setText(
            str(self.mtt_ht) if typ == Invoice.TYPE_BON else "0")
        self.button.setEnabled(True)
Beispiel #6
0
    def save_edit(self):
        ''' add operation '''

        if check_is_empty(self.amount_field):
            return

        amount = int(self.amount_field.text())
        refund_date = unicode(self.refund_date_field.text())

        # self.remaining = self.last_r.remaining
        if check_field(
                self.amount_field, "Ce montant ne peut être supperieur au dettes restante {}.".format(
                self.last_remaining), amount > self.last_remaining):
            return
        refund = self.refund
        refund.type_ = self.type_
        refund.invoice = self.last_r.invoice
        refund.amount = amount
        if self.new:
            refund.provider_client = self.provid_clt
            refund.date = date_to_datetime(refund_date)
        try:
            refund.save()
            self.close()
            self.parent.Notify(u"le {type} {lib} à été enregistré avec succès".format(
                type=self.type_, lib=amount), "success")
            self.table_p.refresh_(provid_clt_id=self.provid_clt.id)
        except Exception as e:
            self.parent.Notify(e, "error")
Beispiel #7
0
    def save_edit(self):
        ''' add operation '''
        if check_is_empty(self.amount_field):
            return

        payment_date = unicode(self.payment_date_field.text())
        libelle = unicode(self.libelle_field.toPlainText())
        amount = int(self.amount_field.text().replace(" ", ""))

        payment = self.payment
        payment.type_ = self.type_
        payment.libelle = libelle
        if self.new:
            payment.date = date_to_datetime(payment_date)
        if self.type_ == Payment.CREDIT:
            payment.credit = amount
        elif self.type_ == Payment.DEBIT:
            payment.debit = amount
        try:
            payment.save()
            self.close()
            self.parent.Notify(u"le {type} {lib} à été enregistré avec succès".format(
                type=self.type_, lib=libelle), "success")
            self.table_p.refresh_()
        except Exception as e:
            self.parent.Notify(e, "error")
Beispiel #8
0
    def save_edit(self):
        ''' add operation '''
        if check_is_empty(self.amount_field):
            return

        payment_date = unicode(self.payment_date_field.text())
        libelle = unicode(self.libelle_field.toPlainText())
        amount = int(self.amount_field.text().replace(" ", ""))

        payment = self.payment
        payment.type_ = self.type_
        payment.libelle = libelle
        if self.new:
            payment.date = date_to_datetime(payment_date)
        if self.type_ == Payment.CREDIT:
            payment.credit = amount
        elif self.type_ == Payment.DEBIT:
            payment.debit = amount
        try:
            payment.save()
            self.close()
            self.parent.Notify(u"le {type} {lib} à été enregistré avec succès".format(
                type=self.type_, lib=libelle), "success")
            self.table_p.refresh_()
        except Exception as e:
            self.parent.Notify(e, "error")
Beispiel #9
0
    def save_edit(self):
        ''' add operation '''

        if check_is_empty(self.amount_field):
            return

        amount = int(self.amount_field.text())
        refund_date = unicode(self.refund_date_field.text())

        # self.remaining = self.last_r.remaining
        if check_field(
                self.amount_field, "Ce montant ne peut être supperieur au dettes restante {}.".format(
                self.last_remaining), amount > self.last_remaining):
            return
        refund = self.refund
        refund.type_ = self.type_
        refund.invoice = self.last_r.invoice
        refund.amount = amount
        if self.new:
            refund.provider_client = self.provid_clt
            refund.date = date_to_datetime(refund_date)
        try:
            refund.save()
            self.close()
            self.parent.Notify(u"le {type} {lib} à été enregistré avec succès".format(
                type=self.type_, lib=amount), "success")
            self.table_p.refresh_(self.provid_clt.id)
        except Exception as e:
            self.parent.Notify(e, "error")
Beispiel #10
0
 def edit_report(self):
     # type_ = self.box_type.currentIndex()
     # product = self.liste_product[self.box_prod.currentIndex()]
     if check_is_empty(self.qty_field):
         return
     if check_is_empty(self.selling_price_field):
         return
     if check_is_empty(self.cost_buying_field):
         return
     report = self.rpt
     report.qty = unicode(self.qty_field.text())
     report.selling_price = unicode(self.selling_price_field.text())
     report.cost_buying = unicode(self.cost_buying_field.text())
     try:
         report.save()
         self.cancel()
         self.table_p.refresh_()
         self.parent.Notify(u"le rapport a été mise à jour", "success")
     except Exception as e:
         self.parent.Notify(e, "error")
Beispiel #11
0
 def edit_report(self):
     # type_ = self.box_type.currentIndex()
     # product = self.liste_product[self.box_prod.currentIndex()]
     if check_is_empty(self.qty_field):
         return
     if check_is_empty(self.selling_price_field):
         return
     if check_is_empty(self.cost_buying_field):
         return
     report = self.rpt
     report.qty = unicode(self.qty_field.text())
     report.selling_price = unicode(self.selling_price_field.text())
     report.cost_buying = unicode(self.cost_buying_field.text())
     try:
         report.save()
         self.cancel()
         self.table_p.refresh_()
         self.parent.Notify(u"le rapport a été mise à jour", "success")
     except Exception as e:
         self.parent.Notify(e, "error")
Beispiel #12
0
    def save_edit(self):
        ''' add operation '''
        name_orga = unicode(self.name_orga.text())
        if check_is_empty(self.name_orga):
            return

        if check_is_empty(self.phone):
            return

        orga = Organization().get(id=1)
        orga.name_orga = name_orga
        orga.phone = unicode(self.phone.text())
        orga.is_login = True if self.checked.checkState() == Qt.Checked else False
        orga.devise = str(self.box_devise.currentText().split()[1])
        orga.email_org = unicode(self.email_org.text())
        orga.bp = unicode(self.bp.text())
        orga.adress_org = unicode(self.adress_org.toPlainText())
        orga.save()
        print(orga.is_login)
        self.parent.parent.Notify(u"Le Compte %s a été mise à jour" %
                                  orga.name_orga, "success")
Beispiel #13
0
    def changed_value(self, refresh=False):
        """ Calcule les Resultat """
        b_f_tt = 0
        v_amount_tt = 0
        for row_num in xrange(0, self.data.__len__()):

            qtsaisi = is_int(self.cellWidget(row_num, 1).text()) or 1
            cost_buying = is_int(self.cellWidget(row_num, 2).text())
            selling_price = is_int(self.cellWidget(row_num, 3).text())

            self.isvalid = True
            # if not selling_price:
            #     return
            if (selling_price and check_is_empty(self.cellWidget(row_num, 1))):
                self.isvalid = False
            if (selling_price and check_is_empty(self.cellWidget(row_num, 2))):
                self.isvalid = False
            if (check_is_empty(self.cellWidget(row_num, 3))):
                self.isvalid = False

            r_amount = qtsaisi * cost_buying
            v_amount = qtsaisi * selling_price
            b_f = v_amount - r_amount
            b_f_u = b_f / qtsaisi

            b_f_tt += b_f
            v_amount_tt += v_amount
            # montt.setTextAlignment(Qt.AlignRight)
            self.setItem(row_num, 4, TotalsWidget(formatted_number(v_amount)))
            self.setItem(row_num, 5, TotalsWidget(formatted_number(b_f_u)))
            self.setItem(row_num, 6, TotalsWidget(formatted_number(b_f)))
            # Mise à jour
            self._update_data(
                row_num,
                [qtsaisi, cost_buying, selling_price, v_amount, b_f_u, b_f])
        row_num += 1
        self.setItem(row_num, 4, TotalsWidget(formatted_number(v_amount_tt)))
        self.setItem(row_num, 6, TotalsWidget(formatted_number(b_f_tt)))
Beispiel #14
0
    def changed_value(self, refresh=False):
        """ Calcule les Resultat """
        b_f_tt = 0
        v_amount_tt = 0
        for row_num in xrange(0, self.data.__len__()):

            qtsaisi = is_int(self.cellWidget(row_num, 1).text()) or 1
            cost_buying = is_int(self.cellWidget(row_num, 2).text())
            selling_price = is_int(self.cellWidget(row_num, 3).text())

            self.isvalid = True
            # if not selling_price:
            #     return
            if (selling_price and check_is_empty(self.cellWidget(row_num, 1))):
                self.isvalid = False
            if (selling_price and check_is_empty(self.cellWidget(row_num, 2))):
                self.isvalid = False
            if (check_is_empty(self.cellWidget(row_num, 3))):
                self.isvalid = False

            r_amount = qtsaisi * cost_buying
            v_amount = qtsaisi * selling_price
            b_f = v_amount - r_amount
            b_f_u = b_f / qtsaisi

            b_f_tt += b_f
            v_amount_tt += v_amount
            # montt.setTextAlignment(Qt.AlignRight)
            self.setItem(row_num, 4, TotalsWidget(formatted_number(v_amount)))
            self.setItem(row_num, 5, TotalsWidget(formatted_number(b_f_u)))
            self.setItem(row_num, 6, TotalsWidget(formatted_number(b_f)))
            # Mise à jour
            self._update_data(
                row_num, [qtsaisi, cost_buying, selling_price, v_amount, b_f_u, b_f])
        row_num += 1
        self.setItem(row_num, 4, TotalsWidget(formatted_number(v_amount_tt)))
        self.setItem(row_num, 6, TotalsWidget(formatted_number(b_f_tt)))
    def save_edit(self):
        ''' add operation '''
        if check_is_empty(self.name_orga):
            return
        if check_is_empty(self.phone):
            return
        name_orga = str(self.name_orga.text())
        device = str(self.box_devise.currentText().split()[1])
        bp = str(self.bp.text())
        email_org = str(self.email_org.text())
        phone = str(self.phone.text())
        adress_org = str(self.adress_org.toPlainText())

        org = Organization()
        org.phone = phone
        org.device = device
        org.name_orga = name_orga
        org.email_org = email_org
        org.bp = bp
        org.adress_org = adress_org
        org.is_login = True if self.checked.checkState(
        ) == Qt.Checked else False
        org.save()
        self.accept()
Beispiel #16
0
    def is_valide(self):
        if check_is_empty(self.denomination_field):
            return False

        if CooperativeCompanie.select().where(
                CooperativeCompanie.denomination ==
                self.denomination_field.text()).exists():
            field_error(
                self.denomination_field,
                "Cette dénomination existe déjà dans la base de données !")
            return False
        if check_is_empty(self.commercial_name_field):
            return False
        if check_is_empty(self.created_date_field):
            return False
        if check_is_empty(self.denomination_field):
            return False
        if check_is_empty(self.apports_numeraire_field):
            return False
        if check_is_empty(self.apports_nature_field):
            return False
        if check_is_empty(self.apports_industrie_field):
            return False
        # if check_is_empty(self.rue_field):
        #     return False
        # if check_is_empty(self.porte_field):
        #     return False
        # print(len(self.tel_field.text()))
        if len(self.tel_field.text()) != 11:
            field_error(self.tel_field, "Numéro requis")
            return False
        # if check_is_empty(self.bp_field):
        #     return False
        # if check_is_empty(self.email_field):
        #     return False
        if check_is_empty(self.duree_statutaire_field):
            return False
        # print(int(self.duree_statutaire_field.text()))
        if int(self.duree_statutaire_field.text()) > 99:
            field_error(
                self.duree_statutaire_field,
                "La durée statutaire ne peut être supérieure à 99 ans")
            return False
        return True
 def check_integrity_validation(self):
     return (self.qualite_declarant_check.isChecked() and
             self.status_check.isChecked() and
             self.pieces_check.isChecked() and
             self.autorisation_pre_immt_check.isChecked() and
             self.demande_immt_check.isChecked() and
             self.pv_check.isChecked() and
             self.chronologique_check.isChecked() and
             self.compte_check.isChecked() and
             self.dispositions_check.isChecked() and
             self.pv_delib_ca_check.isChecked() and
             not check_is_empty(self.forme_scoop_status_field, zero=False) and
             not check_is_empty(self.forme_scoop_ri_field, zero=False) and
             not check_is_empty(self.denomination_status_field, zero=False) and
             not check_is_empty(self.denomination_ri_field, zero=False) and
             not check_is_empty(self.nature_domaine_status_field, zero=False) and
             not check_is_empty(self.nature_domaine_ri_field, zero=False) and
             not check_is_empty(self.duree_status_field, zero=False) and
             not check_is_empty(self.duree_ri_field, zero=False) and
             not check_is_empty(self.lien_commun_status_field, zero=False) and
             not check_is_empty(self.lien_commun_ri_field, zero=False) and
             not check_is_empty(self.coord_initiateur_status_field, zero=False) and
             not check_is_empty(self.coord_initiateur_ri_field, zero=False) and
             not check_is_empty(self.max_min_admin_cg_status_field, zero=False) and
             not check_is_empty(self.max_min_admin_cg_ri_field, zero=False) and
             not check_is_empty(self.max_min_admin_ca_status_field, zero=False) and
             not check_is_empty(self.max_min_admin_ca_ri_field, zero=False) and
             not check_is_empty(self.dispositions_cg_status_field, zero=False) and
             not check_is_empty(self.dispositions_cg_ri_field, zero=False) and
             not check_is_empty(self.dispositions_ca_status_field, zero=False) and
             not check_is_empty(self.dispositions_ca_ri_field, zero=False) and
             not check_is_empty(self.max_min_cs_s_status_field, zero=False) and
             not check_is_empty(self.max_min_cs_s_ri_field, zero=False) and
             not check_is_empty(self.max_min_cs_ca_status_field, zero=False) and
             not check_is_empty(self.max_min_cs_ca_ri_field, zero=False) and
             not check_is_empty(self.dispositions_mo_status_field, zero=False) and
             not check_is_empty(self.dispositions_mo_ri_field, zero=False) and
             not check_is_empty(self.mandat_cs_status_field, zero=False) and
             not check_is_empty(self.mandat_cs_ri_field, zero=False) and
             not check_is_empty(self.parts_sociales_status_field, zero=False) and
             not check_is_empty(self.parts_sociales_ri_field, zero=False) and
             not check_is_empty(self.declatation_status_field, zero=False) and
             not check_is_empty(self.declatation_ri_field, zero=False) and
             not check_is_empty(self.id_apport_nature_status_field, zero=False) and
             not check_is_empty(self.id_apport_nature_ri_field, zero=False) and
             not check_is_empty(self.evaluation_apport_status_field, zero=False) and
             not check_is_empty(self.evaluation_apport_ri_field, zero=False) and
             not check_is_empty(self.capital_social_status_field, zero=False) and
             not check_is_empty(self.capital_social_ri_field, zero=False) and
             not check_is_empty(self.valeur_nominale_status_field, zero=False) and
             not check_is_empty(self.valeur_nominale_ri_field, zero=False) and
             not check_is_empty(self.stipulations_status_field, zero=False) and
             not check_is_empty(self.stipulations_ri_field, zero=False) and
             not check_is_empty(self.modalite_status_field, zero=False) and
             not check_is_empty(self.modalite_ri_field, zero=False) and
             not check_is_empty(self.signature_int_status_field, zero=False) and
             not check_is_empty(self.signature_int_ri_field, zero=False) and
             not check_is_empty(self.etendue_status_field, zero=False) and
             not check_is_empty(self.etendue_ri_field, zero=False) and
             not check_is_empty(self.rendement_status_field, zero=False) and
             not check_is_empty(self.rendement_ri_field, zero=False) and
             not check_is_empty(self.remuneration_status_field, zero=False) and
             not check_is_empty(self.remuneration_ri_field, zero=False) and
             not check_is_empty(self.limite_imposee_status_field, zero=False) and
             not check_is_empty(self.limite_imposee_ri_field, zero=False) and
             not check_is_empty(self.indemnit_status_field, zero=False) and
             not check_is_empty(self.indemnit_ri_field, zero=False) and
             not check_is_empty(self.souscription_status_field, zero=False) and
             not check_is_empty(self.souscription_ri_field, zero=False) and
             not check_is_empty(self.suspension_status_field, zero=False) and
             not check_is_empty(self.suspension_ri_field, zero=False) and
             not check_is_empty(self.attribution_status_field, zero=False) and
             not check_is_empty(self.attribution_ri_field, zero=False) and
             not check_is_empty(self.prescriptions_status_field, zero=False) and
             not check_is_empty(self.prescriptions_ri_field, zero=False))
Beispiel #18
0
 def is_valide(self):
     if check_is_empty(self.password_field):
         return False
     return True
 def is_not_valide(self):
     # print(check_is_empty(self.name_declarant_field))
     if self.quality_box.itemData(self.quality_box.currentIndex()) == Immatriculation.TP:
         if check_is_empty(self.procuration_field) or check_is_empty(self.tel_declarant_field):
             return True
     return check_is_empty(self.name_declarant_field) or check_is_empty(self.tel_declarant_field)
Beispiel #20
0
 def is_valide(self):
     if check_is_empty(self.phone_field):
         return False
     return True