Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/v1.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptosharks131 committed Dec 28, 2023
2 parents 5c24b72 + e28fcfb commit a542a6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand Down

0 comments on commit a542a6c

Please sign in to comment.