diff --git a/.vscode/settings.json b/.vscode/settings.json
index 4b1a30b..4009d4b 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -1,3 +1,4 @@
{
"html.validate.scripts": false
+ "editor.minimap.enabled": false
}
\ No newline at end of file
diff --git a/mondumas/models/stats.py b/mondumas/models/stats.py
index 7a61617..29bacc0 100644
--- a/mondumas/models/stats.py
+++ b/mondumas/models/stats.py
@@ -119,3 +119,13 @@ def get_ca_clients_3y(request, societe, datedeb):
WHERE societe=:societe GROUP BY typecli;"""
results = request.dbsession.execute(query, {'societe': societe, 'date_n': date3.strftime("%Y"), 'date_n-1': date2.strftime("%Y"), 'date_n': datedeb.strftime("%Y")})
return results.fetchall()
+
+def get_delais_pourcent(request, societe, groupe, datedeb):
+
+ query = """SELECT
+ SUM(IF (delai_contact <= 2, 1, 0)) AS delais_inf,
+ SUM(IF (delai_contact > 2, 1, 0)) AS delais_sup
+ FROM bddevfac.dem_devis
+ WHERE societe = :societe AND GROUPE = :groupe AND date >= :datedeb;"""
+ results = request.dbsession.execute(query, {'societe': societe, 'groupe': groupe, 'datedeb': datedeb.strftime("%Y-%m")})
+ return results.fetchall()
diff --git a/mondumas/routes.py b/mondumas/routes.py
index df2dccc..ba0cfff 100644
--- a/mondumas/routes.py
+++ b/mondumas/routes.py
@@ -79,6 +79,7 @@ def includeme(config):
config.add_route('stats_delais', '/stats_delais/{societe}')
config.add_route('ca_groupes', '/ca_groupes/{societe}')
config.add_route('ca_clients', '/ca_clients/{societe}')
+ config.add_route('delais_pourcentage', '/delais_pourcentage/{societe}')
# utils
config.add_route('batch_nuit', '/batch_nuit/{param}')
diff --git a/mondumas/templates/stats/ca_clients.pt b/mondumas/templates/stats/ca_clients.pt
index f0ec189..102db24 100644
--- a/mondumas/templates/stats/ca_clients.pt
+++ b/mondumas/templates/stats/ca_clients.pt
@@ -71,7 +71,7 @@
title: '${title3}',
};
- var chart_ca_12m = new google.visualization.SteppedAreaChart(document.getElementById('chart_ca_12m'));
+ var chart_ca_12m = new google.visualization.ColumnChart(document.getElementById('chart_ca_12m'));
chart_ca_12m.draw(data_ca_12m, options_ca_12m);
var chart_ca_3y_1 = new google.visualization.PieChart(document.getElementById('chart_ca_3y_1'));
diff --git a/mondumas/templates/stats/ca_groupes.pt b/mondumas/templates/stats/ca_groupes.pt
index 62ced17..93cf7f7 100644
--- a/mondumas/templates/stats/ca_groupes.pt
+++ b/mondumas/templates/stats/ca_groupes.pt
@@ -71,7 +71,7 @@
title: '${title3}',
};
- var chart_ca_12m = new google.visualization.SteppedAreaChart(document.getElementById('chart_ca_12m'));
+ var chart_ca_12m = new google.visualization.ColumnChart(document.getElementById('chart_ca_12m'));
chart_ca_12m.draw(data_ca_12m, options_ca_12m);
var chart_ca_3y_1 = new google.visualization.PieChart(document.getElementById('chart_ca_3y_1'));
diff --git a/mondumas/templates/stats/delais_pourcentage.pt b/mondumas/templates/stats/delais_pourcentage.pt
new file mode 100644
index 0000000..5a1537e
--- /dev/null
+++ b/mondumas/templates/stats/delais_pourcentage.pt
@@ -0,0 +1,55 @@
+
+