Vous voici sur le Git Rural du CRAW

Commit 3ba30f3e authored by Patrick Houben's avatar Patrick Houben

bug year renta solde display

parent 7e28013c
......@@ -689,10 +689,10 @@ def create_month_context(dfe1, dfr1, year1,
dfs1 = dfm1.groupby(['x']).sum().reset_index()
dfs1 = compute_solde(dfs1, y_exp, y_rev)
dfs2 = dfm2.groupby(['x']).sum().reset_index()
# LOG.debug(dfs2)
# LOG.debug(dfs1)
dfs2 = compute_solde(dfs2, y_exp, y_rev)
# LOG.debug("compute_solde")
# LOG.debug(dfs2)
# LOG.debug("dfs2 solde")
# LOG.debug(dfs2['solde'])
y_minmax_exprev = compute_month_minmax(dfs1, dfs2, "EXPREV")
ctx["graph_month1"] = graph_display.build_month(
......
......@@ -56,6 +56,7 @@ def build_year(rev, exp, solde, y_minmax, title):
x_title = ["Produit", "Charge", "Solde"]
y = [rev, exp, solde]
# LOG.debug(solde)
er = go.Bar(x=x_title,
y=y,
text=y, textposition='auto',
......
......@@ -56,7 +56,6 @@ def get_year_list(request, which_list='BOTH'):
"""
in param is session list like [2018, 2019]
out param is a list of tuple like [('2018', '2018'), ('2019', '2019')]
No more used from 02/04/2020
"""
year_list_out = []
exp_year_list = json.loads(request.session["exp_year_list"])
......@@ -68,7 +67,13 @@ def get_year_list(request, which_list='BOTH'):
result = set(exp_year_list)
if which_list == 'REV':
result = set(rev_year_list)
# Obligé d'ajouter artificiellement une année pour que le solde du graphique annuel s'affiche
if len(result) == 1:
year_value = list(result)[0]
# year_value = next(iter(result)) fonctionne aussi
year_value2 = year_value - 1
# ajout valeur à un set
result.add(year_value2)
for i in result:
# line = ("{}".format(i), "{}".format(i))
line = (str(i), str(i))
......
......@@ -82,14 +82,13 @@ class MessageMixin():
"""
@property
def build_message(self):
"""Build message"""
action = ""
gender = ""
if "pk" in self.kwargs:
self.pk = self.kwargs.get("pk")
else:
self.pk = ""
# self.display_name = self.pk
"""Build message"""
self.pk = ""
if "upd" in self.request.path:
action = "modifié"
if "add" in self.request.path:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment