diff --git a/mondumas/models/parametres.py b/mondumas/models/parametres.py index 3ee283a..26af5b3 100644 --- a/mondumas/models/parametres.py +++ b/mondumas/models/parametres.py @@ -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;" diff --git a/mondumas/templates/parametres/dashboard.pt b/mondumas/templates/parametres/dashboard.pt index 22cbc0c..afdc0b3 100644 --- a/mondumas/templates/parametres/dashboard.pt +++ b/mondumas/templates/parametres/dashboard.pt @@ -13,6 +13,18 @@ +
| ${item.nomtable} | +${item.societe} | +${item.no_id} | +${item.datemaj.strftime('%d %b, %H:%M')} | +${item.usermaj} | +