diff --git a/back/infolica/models/models.py b/back/infolica/models/models.py index a7173816..9e223ecf 100644 --- a/back/infolica/models/models.py +++ b/back/infolica/models/models.py @@ -260,7 +260,7 @@ class Emolument(Base): tableau_emolument_id = Column(BigInteger, primary_key=True) position = Column(Text, primary_key=True) prix_unitaire = Column(Float) - nombre = Column(Integer) + nombre = Column(Float) batiment = Column(Integer, primary_key=True) batiment_f = Column(Float) montant = Column(Float) diff --git a/back/infolica/routes.py b/back/infolica/routes.py index 73a282f5..5d49ecb5 100644 --- a/back/infolica/routes.py +++ b/back/infolica/routes.py @@ -51,8 +51,6 @@ def includeme(config): config.add_route('operateur_by_id', '/infolica/api/operateurs/{id}') config.add_route('recherche_operateurs', '/infolica/api/recherche_operateurs') config.add_route('recherche_operateurs_s', '/infolica/api/recherche_operateurs/') - config.add_route('add_operateurs_ad', '/infolica/api/add_operateurs_ad') - config.add_route('add_operateurs_ad_s', '/infolica/api/add_operateurs_ad/') #Test (temp endpoint) config.add_route('test_client', '/infolica/api/test_client') #Controle_mutation diff --git a/back/infolica/views/affaire_etape.py b/back/infolica/views/affaire_etape.py index 821899bd..cf712e2b 100644 --- a/back/infolica/views/affaire_etape.py +++ b/back/infolica/views/affaire_etape.py @@ -110,7 +110,7 @@ def etapes_new_view(request): ) for i in lastSteps]) affaire_nom = " (" + affaire.no_access + ")" if affaire.no_access is not None else "" - text = "L'affaire " + str(affaire.id) + affaire_nom + " est en attente pour l'étape "+ affaire_etape_index.nom +"." + text = "L'affaire " + str(affaire.id) + affaire_nom + "" + (" (avec mention urgente)" if affaire.urgent else "") + " est en attente pour l'étape "+ affaire_etape_index.nom +"." text += "

Cadastre: " + str(affaire.cadastre) text += "
Description: " + str(affaire.nom) text += ("


Historique de l'affaire

\ @@ -121,7 +121,7 @@ def etapes_new_view(request): Réalisée le\ Remarque\ " + lastSteps + "") if lastSteps != "" else "" - subject = "Infolica - affaire " + str(affaire.id) + subject = "Infolica - affaire " + str(affaire.id) + (" - URGENT" if affaire.urgent else "") send_mail(request, mail_list, "", subject, html=text) return Utils.get_data_save_response(Constant.SUCCESS_SAVE.format(AffaireEtape.__tablename__)) diff --git a/back/infolica/views/facture_emolument.py b/back/infolica/views/facture_emolument.py index 48e08fc6..91ba49ae 100644 --- a/back/infolica/views/facture_emolument.py +++ b/back/infolica/views/facture_emolument.py @@ -158,7 +158,7 @@ def emolument_new_view(request): tableau_emolument_id=int(batiment_i[emolument_i]['tableau_emolument_id']), position=batiment_i[emolument_i]['nom'], prix_unitaire=float(batiment_i[emolument_i]['prix_unitaire']), - nombre=int(batiment_i[emolument_i]['nombre']), + nombre=float(batiment_i[emolument_i]['nombre']), batiment=int(batiment_i[emolument_i]['batiment']), batiment_f=float(batiment_i[emolument_i]['batiment_f']), montant=float(batiment_i[emolument_i]['montant']) @@ -252,14 +252,14 @@ def update_emolument_view(request): if (not float(record.montant) == float(batiment_i[emolument_i]['montant']) \ or not record.tableau_emolument_id == batiment_i[emolument_i]['tableau_emolument_id'] \ or not record.position == batiment_i[emolument_i]['nom'] \ - or not int(record.nombre) == int(batiment_i[emolument_i]['nombre']) \ + or not float(record.nombre) == float(batiment_i[emolument_i]['nombre']) \ or not float(record.batiment_f) == float(batiment_i[emolument_i]['batiment_f'])): # Mettre à jour les données si le nouveau montant n'est pas nul if float(batiment_i[emolument_i]['montant']) > 0: params = Utils._params( position=batiment_i[emolument_i]['nom'], - nombre=int(batiment_i[emolument_i]['nombre']), + nombre=float(batiment_i[emolument_i]['nombre']), batiment_f=float(batiment_i[emolument_i]['batiment_f']), montant=float(batiment_i[emolument_i]['montant']) ) @@ -276,7 +276,7 @@ def update_emolument_view(request): tableau_emolument_id=int(batiment_i[emolument_i]['tableau_emolument_id']), position=batiment_i[emolument_i]['nom'], prix_unitaire=float(batiment_i[emolument_i]['prix_unitaire']), - nombre=int(batiment_i[emolument_i]['nombre']), + nombre=float(batiment_i[emolument_i]['nombre']), batiment=int(batiment_i[emolument_i]['batiment']), batiment_f=float(batiment_i[emolument_i]['batiment_f']), montant=float(batiment_i[emolument_i]['montant']) diff --git a/back/infolica/views/operateur.py b/back/infolica/views/operateur.py index 6986f04e..0c85c44f 100644 --- a/back/infolica/views/operateur.py +++ b/back/infolica/views/operateur.py @@ -133,49 +133,3 @@ def operateurs_delete_view(request): model.sortie = datetime.utcnow() return Utils.get_data_save_response(Constant.SUCCESS_DELETE.format(Operateur.__tablename__)) - - -@view_config(route_name='add_operateurs_ad', request_method='GET', renderer='json') -@view_config(route_name='add_operateurs_ad_s', request_method='GET', renderer='json') -def add_operateurs_ad_view(request): - """ - Add nouveaux operateurs AD - """ - # Check authorization - if not Utils.has_permission(request, request.registry.settings['fonction_admin']): - raise exc.HTTPForbidden() - - settings = request.registry.settings - login_attr = settings['ldap_user_attribute_login'] - op_added = 0 - - # Operateurs from AD - op_ad = Utils.get_nouveaux_operateurs_ad(request) - - # Logins from DB - op_bd_logins = [] - op_bd_logins_query = request.dbsession.query(Operateur).distinct(Operateur.login).filter( - Operateur.login.isnot(None)).all() - for c in op_bd_logins_query: - op_bd_logins.append(c.login.upper()) - - for one_ad_op in op_ad: - one_ad_op_login = one_ad_op[login_attr] if login_attr in one_ad_op else None - - if one_ad_op_login and one_ad_op_login.upper() not in op_bd_logins: - - one_op_model = Operateur( - login=one_ad_op[settings['ldap_user_attribute_login']], - nom=one_ad_op[settings['ldap_user_attribute_lastname']], - prenom=one_ad_op[settings['ldap_user_attribute_firstname']], - entree=func.now()) - - request.dbsession.add(one_op_model) - op_added = op_added + 1 - - if op_added > 0: - save_response = Utils.get_data_save_response(Constant.SUCCESS_SAVE.format(Operateur.__tablename__)) - save_response['count'] = op_added - return save_response - else: - raise exc.HTTPNoContent diff --git a/front/.env b/front/.env index 38687ee9..f377ce53 100644 --- a/front/.env +++ b/front/.env @@ -21,7 +21,6 @@ VUE_APP_CLIENT_MORAL_PERSONNES_ENDPOINT = "/client_moral_personnes" #Operateurs VUE_APP_OPERATEURS_ENDPOINT = "/operateurs" VUE_APP_SEARCH_OPERATEURS_ENDPOINT = "/recherche_operateurs" -VUE_APP_ADD_OPERATEURS_AD_ENDPOINT = "/add_operateurs_ad" #Cadastres VUE_APP_CADASTRES_ENDPOINT = "/cadastres" diff --git a/front/src/components/Affaires/Facturation/Emoluments/Emoluments.vue b/front/src/components/Affaires/Facturation/Emoluments/Emoluments.vue index 7aa4b5ae..ed5b5d08 100644 --- a/front/src/components/Affaires/Facturation/Emoluments/Emoluments.vue +++ b/front/src/components/Affaires/Facturation/Emoluments/Emoluments.vue @@ -839,7 +839,7 @@ export default { }); } }).catch(err => { - handleException(err, this) + handleException(err, this); // hide progressbar this.showProgressBar = false; this.disabled = false; diff --git a/front/src/components/Affaires/Facturation/Emoluments/emoluments.css b/front/src/components/Affaires/Facturation/Emoluments/emoluments.css index e7b2a54a..6ebcafdb 100644 --- a/front/src/components/Affaires/Facturation/Emoluments/emoluments.css +++ b/front/src/components/Affaires/Facturation/Emoluments/emoluments.css @@ -129,4 +129,8 @@ border-left: 0px !important; border-right: 0px !important; padding-bottom: 10px !important; -} \ No newline at end of file +} + +.highlightEmolument { + background-color: lightgreen; +} diff --git a/front/src/components/Affaires/Facturation/Emoluments/emoluments.html b/front/src/components/Affaires/Facturation/Emoluments/emoluments.html index 95628505..39cfd0fd 100644 --- a/front/src/components/Affaires/Facturation/Emoluments/emoluments.html +++ b/front/src/components/Affaires/Facturation/Emoluments/emoluments.html @@ -172,7 +172,7 @@

Bâtiments

{{ form_detail.mandat1.nom }} {{ form_detail.mandat1.unite }} {{ form_detail.mandat1.prix_unitaire }} CHF - + {{ form_detail.mandat1.montant }} CHF