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;"