Skip to content

Commit

Permalink
Merge pull request #558 from rufener/bugfixes
Browse files Browse the repository at this point in the history
bugfixes
  • Loading branch information
rufener authored Sep 1, 2021
2 parents 8077198 + 20bdf99 commit 6959aba
Show file tree
Hide file tree
Showing 17 changed files with 495 additions and 659 deletions.
2 changes: 1 addition & 1 deletion back/infolica/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions back/infolica/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions back/infolica/views/affaire_etape.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <b><a href='" + os.path.join(request.registry.settings['infolica_url_base'], 'affaires/edit', str(affaire.id)) + "'>" + str(affaire.id) + affaire_nom + "</a></b> est en attente pour l'étape <b>"+ affaire_etape_index.nom +"</b>."
text = "L'affaire <b><a href='" + os.path.join(request.registry.settings['infolica_url_base'], 'affaires/edit', str(affaire.id)) + "'>" + str(affaire.id) + affaire_nom + "</a></b>" + (" (avec mention urgente)" if affaire.urgent else "") + " est en attente pour l'étape <b>"+ affaire_etape_index.nom +"</b>."
text += "<br><br>Cadastre: " + str(affaire.cadastre)
text += "<br>Description: " + str(affaire.nom)
text += ("<br><br><br><h4>Historique de l'affaire</h4>\
Expand All @@ -121,7 +121,7 @@ def etapes_new_view(request):
<th style='border: 1px solid black; border-collapse: collapse; padding: 5px 25px 5px 10px;'>Réalisée le</th>\
<th style='border: 1px solid black; border-collapse: collapse; padding: 5px 25px 5px 10px;'>Remarque</th>\
</tr>" + lastSteps + "</table>") 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__))
Expand Down
8 changes: 4 additions & 4 deletions back/infolica/views/facture_emolument.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down Expand Up @@ -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'])
)
Expand All @@ -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'])
Expand Down
46 changes: 0 additions & 46 deletions back/infolica/views/operateur.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion front/.env
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ export default {
});
}
}).catch(err => {
handleException(err, this)
handleException(err, this);
// hide progressbar
this.showProgressBar = false;
this.disabled = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,8 @@
border-left: 0px !important;
border-right: 0px !important;
padding-bottom: 10px !important;
}
}

.highlightEmolument {
background-color: lightgreen;
}
Loading

0 comments on commit 6959aba

Please sign in to comment.