fix cash flow calc again 3
authorgniibe <gniibe@fsij.org>
Mon, 11 Jun 2012 11:35:25 +0000 (20:35 +0900)
committergniibe <gniibe@fsij.org>
Mon, 11 Jun 2012 11:35:25 +0000 (20:35 +0900)
accounting/models.py

index 004bb85..3cca45a 100644 (file)
@@ -125,7 +125,10 @@ class GeneralLedgerEntry(object):
                 if le.account.is_cash or (cores_le.is_credit == le.is_credit):
                     cash_total = 0
                 else:
-                    cash_total = total
+                    if total > cores_le:
+                        cash_total = cores_le.amount
+                    else:
+                        cash_total = total
             except:
                 cash_total = 0
             try: