From e28fcfbde28caca2e99390b21d48d588b7f36b9a Mon Sep 17 00:00:00 2001 From: cryptosharks131 Date: Thu, 28 Dec 2023 15:30:43 -0500 Subject: [PATCH] Fix v5 chart issue --- gui/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/views.py b/gui/views.py index d134d138..5b7ab606 100644 --- a/gui/views.py +++ b/gui/views.py @@ -685,7 +685,7 @@ def chart(request): invoices = Invoices.objects.filter(state=1, is_revenue=True).annotate(dt=TruncDay('settle_date')).values('dt').annotate(cost=Value(0, output_field=FloatField()), revenue=Sum('amt_paid', output_field=FloatField()), onchain=Value(0)) forwards = Forwards.objects.annotate(dt=TruncDay('forward_date')).values('dt').annotate(cost=Value(0, output_field=FloatField()), revenue=Sum('fee', output_field=FloatField()), onchain=Value(0)) onchain = Onchain.objects.annotate(dt=TruncDay('time_stamp')).values('dt').annotate(cost=Value(0, output_field=FloatField()), revenue=Value(0, output_field=FloatField()), onchain=Sum('amount')) - balance = DataFrame.from_records(payments.union(invoices, forwards, onchain).values('dt', 'cost', 'onchain', 'revenue')) + balance = DataFrame.from_records(payments.union(invoices, forwards, onchain).values('dt', 'cost', 'revenue', 'onchain')) results = balance.groupby('dt').sum().reset_index().sort_values('dt') return Response(results.to_dict(orient='records'))