fix cash flow calc again 19
authorgniibe <gniibe@fsij.org>
Mon, 11 Jun 2012 15:02:54 +0000 (00:02 +0900)
committergniibe <gniibe@fsij.org>
Mon, 11 Jun 2012 15:02:54 +0000 (00:02 +0900)
accounting/models.py

index 7074b15..fe8ac1e 100644 (file)
@@ -123,7 +123,7 @@ class GeneralLedgerEntry(object):
             if le.t.ledgerentry_set.filter(account__is_cash=True).count() > 0:
                 if le.account.is_cash:
                     cash_total = 0
-                elif le.account.type.value == 2 and total < 0 and le.t.ledgerentry_set.filter(is_credit=not le.is_credit).filter(account__is_cash=True).count() == 0:
+                elif le.account.type.value == 2 and total < 0 and le.t.ledgerentry_set.filter(is_credit=not le.is_credit,account__is_cash=True).count() == 0:
                     cash_total = 0
                 else:
                     cash_total = total