fix cash flow calc again 10
authorgniibe <gniibe@fsij.org>
Mon, 11 Jun 2012 13:47:44 +0000 (22:47 +0900)
committergniibe <gniibe@fsij.org>
Mon, 11 Jun 2012 13:47:44 +0000 (22:47 +0900)
accounting/models.py

index a2223f9..d5ebc94 100644 (file)
@@ -120,7 +120,7 @@ class GeneralLedgerEntry(object):
                 total = le.amount
             else:
                 total = -le.amount
-            if le.t.ledgerentry_set.count(account__is_cash=True) > 0:
+            if le.t.ledgerentry_set.filter(account__is_cash=True).count() > 0:
                 if le.account.is_cash or (le.account.type.value == 2 and total < 0):
                     cash_total = 0
                 else: