mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-05 12:41:49 +02:00
Merge 6c31f89db4
into 4d5c8a507b
This commit is contained in:
commit
d27b7b2aaa
1 changed files with 3 additions and 2 deletions
|
@ -35,10 +35,11 @@ class Project(db.Model):
|
|||
for time in (1, 2, 3))
|
||||
|
||||
# for each person
|
||||
bills_in_project = self.get_bills()
|
||||
for person in self.members:
|
||||
# get the list of bills he has to pay
|
||||
bills = Bill.query.filter(Bill.owers.contains(person))
|
||||
for bill in bills.all():
|
||||
bills = bills_in_project.filter(Bill.owers.contains(person)).all()
|
||||
for bill in bills:
|
||||
if person != bill.payer:
|
||||
share = bill.pay_each() * person.weight
|
||||
should_pay[person] += share
|
||||
|
|
Loading…
Reference in a new issue