From 642885a18663b8c569dd56ed64dbe98d530e5b76 Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Fri, 10 Apr 2020 08:51:23 +0800 Subject: [PATCH] Revert "Bug 797659 - Liabilities in budget report no longer calculate correctly" This reverts commit 2329c1c508dc4e8849089e17328e8c7c3c05f270. Reverted for snap release. Not tested thoroughly yet. Bug 797659 need further betatesters. --- gnucash/gnome/gnc-budget-view.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c index 05559a524d..7b44c294ac 100644 --- a/gnucash/gnome/gnc-budget-view.c +++ b/gnucash/gnome/gnc-budget-view.c @@ -1202,9 +1202,10 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell, switch (row_type) { case TOTALS_TYPE_ASSET_LIAB_EQ: - if ((acctype != ACCT_TYPE_ASSET) && - (acctype != ACCT_TYPE_EQUITY) && - (acctype != ACCT_TYPE_LIABILITY)) + if ((acctype == ACCT_TYPE_LIABILITY) || + (acctype == ACCT_TYPE_EQUITY)) + neg = !neg; + else if (acctype != ACCT_TYPE_ASSET) continue; break; case TOTALS_TYPE_EXPENSES: @@ -1217,7 +1218,10 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell, neg = !neg; break; case TOTALS_TYPE_REMAINDER: - neg = !neg; + if ((acctype == ACCT_TYPE_ASSET) || + (acctype == ACCT_TYPE_INCOME) || + (acctype == ACCT_TYPE_EXPENSE)) + neg = !neg; break; default: continue; /* don't count if unexpected total row type is passed in... */ @@ -1231,7 +1235,6 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell, switch (row_type) { case TOTALS_TYPE_ASSET_LIAB_EQ: - neg = (acctype == ACCT_TYPE_ASSET); if ((acctype != ACCT_TYPE_ASSET) && (acctype != ACCT_TYPE_LIABILITY) && (acctype != ACCT_TYPE_EQUITY)) @@ -1246,8 +1249,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell, continue; break; case TOTALS_TYPE_REMAINDER: - neg = ((acctype == ACCT_TYPE_ASSET) || - (acctype == ACCT_TYPE_EXPENSE)); + neg = (acctype != ACCT_TYPE_INCOME); break; default: continue; /* don't count if unexpected total row type is passed in... */