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,