gnucash maint: Bug 797659 - Liabilities in budget report no longer calculate correctly
Christopher Lam
clam at code.gnucash.org
Fri May 8 08:54:59 EDT 2020
Updated via https://github.com/Gnucash/gnucash/commit/79286d92 (commit)
from https://github.com/Gnucash/gnucash/commit/601aec8c (commit)
commit 79286d92d570135d7697eb3a65cbe725a9a8b449
Author: Christopher Lam <christopher.lck at gmail.com>
Date: Sat May 2 11:11:21 2020 +0800
Bug 797659 - Liabilities in budget report no longer calculate correctly
Restores budget-3.7 behaviour for current budgets.
Fixes future budget behaviour.
Restore budget-3.7 headings "Income/Expense/Transfer"
Renamed budget-3.7 heading Total to "Remaining"
diff --git a/gnucash/gnome/gnc-budget-view.c b/gnucash/gnome/gnc-budget-view.c
index 7b44c294a..046efef3b 100644
--- a/gnucash/gnome/gnc-budget-view.c
+++ b/gnucash/gnome/gnc-budget-view.c
@@ -447,11 +447,11 @@ gbv_create_widget (GncBudgetView *budget_view)
// Create totals tree view
totals_tree_model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
gtk_list_store_append(totals_tree_model, &iter);
- gtk_list_store_set(totals_tree_model, &iter, 0, _("Inflow from Income"), 1, TOTALS_TYPE_INCOME, -1);
+ gtk_list_store_set(totals_tree_model, &iter, 0, _("Income"), 1, TOTALS_TYPE_INCOME, -1);
gtk_list_store_append(totals_tree_model, &iter);
- gtk_list_store_set(totals_tree_model, &iter, 0, _("Outflow to Expenses"), 1, TOTALS_TYPE_EXPENSES, -1);
+ gtk_list_store_set(totals_tree_model, &iter, 0, _("Expenses"), 1, TOTALS_TYPE_EXPENSES, -1);
gtk_list_store_append(totals_tree_model, &iter);
- gtk_list_store_set(totals_tree_model, &iter, 0, _("Outflow to Asset/Equity/Liability"), 1, TOTALS_TYPE_ASSET_LIAB_EQ, -1);
+ gtk_list_store_set(totals_tree_model, &iter, 0, _("Transfer"), 1, TOTALS_TYPE_ASSET_LIAB_EQ, -1);
gtk_list_store_append(totals_tree_model, &iter);
gtk_list_store_set(totals_tree_model, &iter, 0, _("Remaining to Budget"), 1, TOTALS_TYPE_REMAINDER, -1);
@@ -1202,11 +1202,11 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
switch (row_type)
{
case TOTALS_TYPE_ASSET_LIAB_EQ:
- if ((acctype == ACCT_TYPE_LIABILITY) ||
- (acctype == ACCT_TYPE_EQUITY))
- neg = !neg;
- else if (acctype != ACCT_TYPE_ASSET)
+ if ((acctype != ACCT_TYPE_ASSET) &&
+ (acctype != ACCT_TYPE_LIABILITY) &&
+ (acctype != ACCT_TYPE_EQUITY))
continue;
+ neg = !neg;
break;
case TOTALS_TYPE_EXPENSES:
if (acctype != ACCT_TYPE_EXPENSE)
@@ -1218,10 +1218,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
neg = !neg;
break;
case TOTALS_TYPE_REMAINDER:
- if ((acctype == ACCT_TYPE_ASSET) ||
- (acctype == ACCT_TYPE_INCOME) ||
- (acctype == ACCT_TYPE_EXPENSE))
- neg = !neg;
+ neg = !neg;
break;
default:
continue; /* don't count if unexpected total row type is passed in... */
@@ -1239,6 +1236,7 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
(acctype != ACCT_TYPE_LIABILITY) &&
(acctype != ACCT_TYPE_EQUITY))
continue;
+ neg = (acctype == ACCT_TYPE_ASSET);
break;
case TOTALS_TYPE_EXPENSES:
if (acctype != ACCT_TYPE_EXPENSE)
@@ -1249,7 +1247,8 @@ totals_col_source (GtkTreeViewColumn *col, GtkCellRenderer *cell,
continue;
break;
case TOTALS_TYPE_REMAINDER:
- neg = (acctype != ACCT_TYPE_INCOME);
+ neg = ((acctype == ACCT_TYPE_ASSET) ||
+ (acctype == ACCT_TYPE_EXPENSE));
break;
default:
continue; /* don't count if unexpected total row type is passed in... */
Summary of changes:
gnucash/gnome/gnc-budget-view.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
More information about the gnucash-changes
mailing list