added last modified tables in dashboard

This commit is contained in:
2023-10-14 16:10:02 +02:00
parent b0f25625ee
commit 07011002f3
4 changed files with 35 additions and 1 deletions

View File

@@ -17,6 +17,25 @@ def get_log_nuit(request, ):
results = request.dbsession.execute(query, )
return results.fetchall()
def get_last_modified(request,):
query = """
SELECT 'DEMANDES' as nomtable, societe, no_id, datemaj, usermaj FROM bddevfac.dem_devis where date(datemaj)=CURDATE()
UNION
SELECT 'DEM_LIGNE' as nomtable, societe, no_id, datemaj, usermaj FROM bddevfac.dem_lig where date(datemaj)=CURDATE()
UNION
SELECT 'DEVIS' as nomtable, societe, no_id, datemaj, usermaj FROM bddevfac.devis where date(datemaj)=CURDATE()
UNION
SELECT 'DEVIS_LIG' as nomtable, societe, no_id, datemaj, usermaj FROM bddevfac.devis_lig where date(datemaj)=CURDATE()
UNION
SELECT 'FACTURES' as nomtable, societe, no_id, datemaj, usermaj FROM bddevfac.facture where date(datemaj)=CURDATE()
UNION
SELECT 'FACT_LIG' as nomtable, societe, no_id, datemaj, usermaj FROM bddevfac.facture_lig where date(datemaj)=CURDATE()
UNION
SELECT 'FAC_REGL' as nomtable, societe, cod_bnq, date as datemaj, JST FROM bddevfac.facture_reg where date(date)=CURDATE()
order by datemaj desc limit 10; """
results = request.dbsession.execute(query, )
return results.fetchall()
def get_rappels_rdv(request):
"""Lire les 200 derniers envois d'emails"""
query = "SELECT * FROM email_rappels ORDER BY no_id DESC LIMIT 400;"

View File

@@ -13,6 +13,18 @@
</table>
</div>
<div class="row">
<h2>Dernières modifications</h2>
<table class="table table-condensed">
<tr tal:repeat="item last_modified">
<td>${item.nomtable}</td>
<td>${item.societe}</td>
<td>${item.no_id}</td>
<td>${item.datemaj.strftime('%d %b, %H:%M')}</td>
<td>${item.usermaj}</td>
</tr>
</table>
</div>
</div><!-- content -->
</metal:block>

View File

@@ -50,7 +50,7 @@
<h4>CONNEXIONS</h4>
</div>
<div class="col-sm-3">
<a href="${request.application_url}/stats_dd/PE"><span class="glyphicon glyphicon-wrench logo-primary"></span></a>
<a href="${request.application_url}/stats"><span class="glyphicon glyphicon-wrench logo-primary"></span></a>
<h4>STATS GLOBALES</h4>
</div>
</div>

View File

@@ -157,10 +157,13 @@ def dashboard(request):
# lire le log de nuit
log_nuit = get_log_nuit(request)
# lire les dernières modifs dans tables
last_modified = get_last_modified(request)
return {
'page_title': "Tableau de bord",
'log_nuit': log_nuit,
'last_modified': last_modified,
}
@view_config(route_name='rappels_rdv', renderer='../templates/parametres/rappels_rdv.pt', permission='manage')