corrections infobox + stats
This commit is contained in:
@@ -177,21 +177,20 @@ def ca_groupes(request):
|
||||
chart_ca_12m = []
|
||||
# titre des colonnes
|
||||
chart_ca_12m.append(('Mois', 'AXA', { 'type':'string','role': 'tooltip'}, 'MAIF', { 'type':'string','role': 'tooltip'}))
|
||||
title = 'CA / MOIS'
|
||||
title = 'CA sur 12 mois'
|
||||
for item in items:
|
||||
# construire la liste pour donut cible
|
||||
tooltipMAIF = item.date + ' \nCA: '+str(item.MAIF_ca) + ' €\nDossiers: '+str(round(item.MAIF_nb))
|
||||
tooltipAXA = item.date + ' \nCA: '+str(item.AXA_ca) + ' €\nDossiers: '+str(round(item.AXA_nb))
|
||||
tooltipMAIF = item.date[:3] + ' ' + item.date[-4:] + ' \nCA: '+str(item.MAIF_ca) + ' €\nDossiers: '+str(round(item.MAIF_nb))
|
||||
tooltipAXA = item.date[:3] + ' ' + item.date[-4:] + ' \nCA: '+str(item.AXA_ca) + ' €\nDossiers: '+str(round(item.AXA_nb))
|
||||
# ('+str(item.population)+')/n'
|
||||
d = (item.mois, float(item.AXA_ca), tooltipAXA, float(item.MAIF_ca), tooltipMAIF)
|
||||
d = (item.mois[:3], float(item.AXA_ca), tooltipAXA, float(item.MAIF_ca), tooltipMAIF)
|
||||
chart_ca_12m.append(d)
|
||||
|
||||
# debut = aujourd'hui - 11 mois
|
||||
datedeb = date.today()
|
||||
datedeb.replace(month=1,day=1)
|
||||
thisyear = date.today().year
|
||||
|
||||
# lire les CA par mois
|
||||
items = get_ca_groupe_3y(request, societe, datedeb)
|
||||
items = get_ca_groupe_3y(request, societe, thisyear)
|
||||
chart_ca_3y_1 = []
|
||||
chart_ca_3y_2 = []
|
||||
chart_ca_3y_3 = []
|
||||
@@ -199,9 +198,9 @@ def ca_groupes(request):
|
||||
chart_ca_3y_1.append(('Groupe', 'CA', { 'type':'string','role': 'tooltip'}))
|
||||
chart_ca_3y_2.append(('Groupe', 'CA', { 'type':'string','role': 'tooltip'}))
|
||||
chart_ca_3y_3.append(('Groupe', 'CA', { 'type':'string','role': 'tooltip'}))
|
||||
title1 = 'CA ' + (datedeb + relativedelta(years=-2)).strftime("%Y")
|
||||
title2 = 'CA ' + (datedeb + relativedelta(years=-1)).strftime("%Y")
|
||||
title3 = 'CA ' + datedeb.strftime("%Y")
|
||||
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))
|
||||
@@ -253,26 +252,25 @@ def ca_clients(request):
|
||||
chart_ca_12m.append(('Mois', 'ASSURANCES', { 'type':'string','role': 'tooltip'}, 'EXPERTS', { 'type':'string','role': 'tooltip'},
|
||||
'GROUPEMENT', { 'type':'string','role': 'tooltip'}, 'PARTICULIER', { 'type':'string','role': 'tooltip'},
|
||||
'REGIES', { 'type':'string','role': 'tooltip'}, 'SOCIETE', { 'type':'string','role': 'tooltip'}))
|
||||
title = 'CA / MOIS'
|
||||
title = 'CA sur 12 mois'
|
||||
for item in items:
|
||||
# construire la liste pour donut cible
|
||||
tooltipA = item.date + ' \nCA: '+str(item.A_ca) + ' €\nDossiers: '+str(round(item.A_nb))
|
||||
tooltipE = item.date + ' \nCA: '+str(item.E_ca) + ' €\nDossiers: '+str(round(item.E_nb))
|
||||
tooltipG = item.date + ' \nCA: '+str(item.G_ca) + ' €\nDossiers: '+str(round(item.G_nb))
|
||||
tooltipP = item.date + ' \nCA: '+str(item.P_ca) + ' €\nDossiers: '+str(round(item.P_nb))
|
||||
tooltipR = item.date + ' \nCA: '+str(item.R_ca) + ' €\nDossiers: '+str(round(item.R_nb))
|
||||
tooltipS = item.date + ' \nCA: '+str(item.S_ca) + ' €\nDossiers: '+str(round(item.S_nb))
|
||||
tooltipA = item.date[:3] + ' ' + item.date[-4:] + ' \nCA: '+str(item.A_ca) + ' €\nDossiers: '+str(round(item.A_nb))
|
||||
tooltipE = item.date[:3] + ' ' + item.date[-4:] + ' \nCA: '+str(item.E_ca) + ' €\nDossiers: '+str(round(item.E_nb))
|
||||
tooltipG = item.date[:3] + ' ' + item.date[-4:] + ' \nCA: '+str(item.G_ca) + ' €\nDossiers: '+str(round(item.G_nb))
|
||||
tooltipP = item.date[:3] + ' ' + item.date[-4:] + ' \nCA: '+str(item.P_ca) + ' €\nDossiers: '+str(round(item.P_nb))
|
||||
tooltipR = item.date[:3] + ' ' + item.date[-4:] + ' \nCA: '+str(item.R_ca) + ' €\nDossiers: '+str(round(item.R_nb))
|
||||
tooltipS = item.date[:3] + ' ' + item.date[-4:] + ' \nCA: '+str(item.S_ca) + ' €\nDossiers: '+str(round(item.S_nb))
|
||||
# ('+str(item.population)+')/n'
|
||||
d = (item.mois, float(item.A_ca), tooltipA, float(item.E_ca), tooltipE, float(item.G_ca), tooltipG,
|
||||
d = (item.mois[:3], float(item.A_ca), tooltipA, float(item.E_ca), tooltipE, float(item.G_ca), tooltipG,
|
||||
float(item.P_ca), tooltipP, float(item.R_ca), tooltipR, float(item.S_ca), tooltipS)
|
||||
chart_ca_12m.append(d)
|
||||
|
||||
# debut = aujourd'hui - 11 mois
|
||||
datedeb = date.today()
|
||||
datedeb.replace(month=1,day=1)
|
||||
thisyear = date.today().year
|
||||
|
||||
# lire les CA par mois
|
||||
items = get_ca_clients_3y(request, societe, datedeb)
|
||||
items = get_ca_clients_3y(request, societe, thisyear)
|
||||
chart_ca_3y_1 = []
|
||||
chart_ca_3y_2 = []
|
||||
chart_ca_3y_3 = []
|
||||
@@ -280,24 +278,36 @@ def ca_clients(request):
|
||||
chart_ca_3y_1.append(('Clients', 'CA', { 'type':'string','role': 'tooltip'}))
|
||||
chart_ca_3y_2.append(('Clients', 'CA', { 'type':'string','role': 'tooltip'}))
|
||||
chart_ca_3y_3.append(('Clients', 'CA', { 'type':'string','role': 'tooltip'}))
|
||||
title1 = 'CA ' + (datedeb + relativedelta(years=-2)).strftime("%Y")
|
||||
title2 = 'CA ' + (datedeb + relativedelta(years=-1)).strftime("%Y")
|
||||
title3 = 'CA ' + datedeb.strftime("%Y")
|
||||
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.LIB + ' \nCA: '+str(item.Annee1) + ' €\nDossiers: '+str(round(item.Count1))
|
||||
tooltip_y2 = item.LIB + ' \nCA: '+str(item.Annee2) + ' €\nDossiers: '+str(round(item.Count1))
|
||||
tooltip_y3 = item.LIB + ' \nCA: '+str(item.Annee3) + ' €\nDossiers: '+str(round(item.Count1))
|
||||
# ('+str(item.population)+')/n'
|
||||
d1 = (item.LIB, float(item.Annee1), tooltip_y1)
|
||||
if item.Annee1 > 0:
|
||||
ca = float(item.Annee1)
|
||||
else:
|
||||
ca = 0
|
||||
d1 = (item.LIB, ca, tooltip_y1)
|
||||
chart_ca_3y_1.append(d1)
|
||||
d2 = (item.LIB, float(item.Annee2), tooltip_y2)
|
||||
if item.Annee2 > 0:
|
||||
ca = float(item.Annee2)
|
||||
else:
|
||||
ca = 0
|
||||
d2 = (item.LIB, ca, tooltip_y2)
|
||||
chart_ca_3y_2.append(d2)
|
||||
d3 = (item.LIB, float(item.Annee3), tooltip_y3)
|
||||
if item.Annee3 > 0:
|
||||
ca = float(item.Annee3)
|
||||
else:
|
||||
ca = 0
|
||||
d3 = (item.LIB, ca, tooltip_y3)
|
||||
chart_ca_3y_3.append(d3)
|
||||
|
||||
return {
|
||||
'page_title': "CA par clients",
|
||||
'page_title': "CA par types de clients",
|
||||
'url': url,
|
||||
'chart_ca_12m': json.dumps(chart_ca_12m),
|
||||
'chart_ca_3y_1': json.dumps(chart_ca_3y_1),
|
||||
|
||||
Reference in New Issue
Block a user