fix cash flow calc again 16
authorgniibe <gniibe@fsij.org>
Mon, 11 Jun 2012 14:31:04 +0000 (23:31 +0900)
committergniibe <gniibe@fsij.org>
Mon, 11 Jun 2012 14:31:04 +0000 (23:31 +0900)
accounting/models.py

index e56dcbc..d278702 100644 (file)
@@ -128,7 +128,7 @@ class GeneralLedgerEntry(object):
                     for c_le in le.t.ledgerentry_set.filter(is_credit=not le.is_credit):
                         if not c_le.account.is_cash and c_le.account.type.value == 2:
                             cash_total = cash_total - c_le.amount
-                    if cash_total < 0:
+                    if total >= 0 and cash_total < 0:
                         cash_total = 0
             else:
                 cash_total = 0