ajout ca groupe global
This commit is contained in:
@@ -218,6 +218,32 @@ def ca_groupes(request):
|
||||
d3 = (item.groupe, float(item.Annee3), tooltip_y3)
|
||||
chart_ca_3y_3.append(d3)
|
||||
|
||||
# lire les CA par mois
|
||||
items = get_ca_groupe_3y_with_others(request, societe, thisyear)
|
||||
chart_ca_3y_1_x = []
|
||||
chart_ca_3y_2_x = []
|
||||
chart_ca_3y_3_x = []
|
||||
# titre des colonnes
|
||||
chart_ca_3y_1_x.append(('Groupe', 'CA', { 'type':'string','role': 'tooltip'}))
|
||||
chart_ca_3y_2_x.append(('Groupe', 'CA', { 'type':'string','role': 'tooltip'}))
|
||||
chart_ca_3y_3_x.append(('Groupe', 'CA', { 'type':'string','role': 'tooltip'}))
|
||||
title1 = 'CA ' + str(thisyear - 2)
|
||||
title2 = 'CA ' + str(thisyear - 1)
|
||||
title3 = 'CA ' + str(thisyear)
|
||||
for item in items:
|
||||
# construire la liste pour donut cible
|
||||
tooltip_y1 = item.groupe + ' \nCA: '+str(item.Annee1) + ' €\nDossiers: '+str(round(item.Count1))
|
||||
tooltip_y2 = item.groupe + ' \nCA: '+str(item.Annee2) + ' €\nDossiers: '+str(round(item.Count1))
|
||||
tooltip_y3 = item.groupe + ' \nCA: '+str(item.Annee3) + ' €\nDossiers: '+str(round(item.Count1))
|
||||
# ('+str(item.population)+')/n'
|
||||
d1_x = (item.groupe, float(item.Annee1), tooltip_y1)
|
||||
chart_ca_3y_1_x.append(d1_x)
|
||||
d2_x = (item.groupe, float(item.Annee2), tooltip_y2)
|
||||
chart_ca_3y_2_x.append(d2_x)
|
||||
d3_x = (item.groupe, float(item.Annee3), tooltip_y3)
|
||||
chart_ca_3y_3_x.append(d3_x)
|
||||
|
||||
|
||||
return {
|
||||
'page_title': "CA par groupe",
|
||||
'url': url,
|
||||
@@ -225,6 +251,9 @@ def ca_groupes(request):
|
||||
'chart_ca_3y_1': json.dumps(chart_ca_3y_1),
|
||||
'chart_ca_3y_2': json.dumps(chart_ca_3y_2),
|
||||
'chart_ca_3y_3': json.dumps(chart_ca_3y_3),
|
||||
'chart_ca_3y_1_x': json.dumps(chart_ca_3y_1_x),
|
||||
'chart_ca_3y_2_x': json.dumps(chart_ca_3y_2_x),
|
||||
'chart_ca_3y_3_x': json.dumps(chart_ca_3y_3_x),
|
||||
'title': title,
|
||||
'title1': title1,
|
||||
'title2': title2,
|
||||
|
||||
Reference in New Issue
Block a user