From 034d8c43b663ac3a33f6e3d06bcdcbbeea0bc517 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 3 Aug 2020 19:37:42 +0200 Subject: [PATCH] Display invalid transactions but don't count on them in the total --- management/commands/send_reports.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/management/commands/send_reports.py b/management/commands/send_reports.py index 0f9ec2f..1762328 100644 --- a/management/commands/send_reports.py +++ b/management/commands/send_reports.py @@ -30,8 +30,8 @@ class Command(BaseCommand): continue table = HistoryTable(last_transactions) - incoming = sum(tr.total for tr in last_transactions if tr.destination.pk == note.pk) - outcoming = sum(tr.total for tr in last_transactions if tr.source.pk == note.pk) + incoming = sum(tr.total for tr in last_transactions if tr.destination.pk == note.pk if tr.valid) + outcoming = sum(tr.total for tr in last_transactions if tr.source.pk == note.pk if tr.valid) context = dict( user=note.user, table=table,