mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 09:22:38 +02:00
Remove dead settlement code (we switched to an external lib long ago)
This commit is contained in:
parent
a3d4e4250d
commit
eef67cf84c
1 changed files with 0 additions and 17 deletions
|
@ -209,7 +209,6 @@ class Project(db.Model):
|
|||
)
|
||||
return pretty_transactions
|
||||
|
||||
# cache value for better performance
|
||||
members = {person.id: person for person in self.members}
|
||||
settle_plan = settle(self.balance.items()) or []
|
||||
|
||||
|
@ -225,22 +224,6 @@ class Project(db.Model):
|
|||
|
||||
return prettify(transactions, pretty_output)
|
||||
|
||||
def exactmatch(self, credit, debts):
|
||||
"""Recursively try and find subsets of 'debts' whose sum is equal to credit"""
|
||||
if not debts:
|
||||
return None
|
||||
if debts[0]["balance"] > credit:
|
||||
return self.exactmatch(credit, debts[1:])
|
||||
elif debts[0]["balance"] == credit:
|
||||
return [debts[0]]
|
||||
else:
|
||||
match = self.exactmatch(credit - debts[0]["balance"], debts[1:])
|
||||
if match:
|
||||
match.append(debts[0])
|
||||
else:
|
||||
match = self.exactmatch(credit, debts[1:])
|
||||
return match
|
||||
|
||||
def has_bills(self):
|
||||
"""return if the project do have bills or not"""
|
||||
return self.get_bills_unordered().count() > 0
|
||||
|
|
Loading…
Reference in a new issue