fixed calculation issue (archived bills are no longer calculated)

This commit is contained in:
Maimoonah Almashhadani 2022-11-11 14:16:34 +03:00
parent 28f99c9506
commit b9d705da79

View file

@ -114,6 +114,7 @@ class Project(db.Model):
balances, should_pay, should_receive = (defaultdict(int) for time in (1, 2, 3)) balances, should_pay, should_receive = (defaultdict(int) for time in (1, 2, 3))
for bill in self.get_bills_unordered().all(): for bill in self.get_bills_unordered().all():
if not bill.archive:
should_receive[bill.payer.id] += bill.converted_amount should_receive[bill.payer.id] += bill.converted_amount
total_weight = sum(ower.weight for ower in bill.owers) total_weight = sum(ower.weight for ower in bill.owers)
for ower in bill.owers: for ower in bill.owers: