From b9deb5ea2a870f1568c8342b60a6df9c44772344 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Sat, 11 Sep 2021 10:11:36 -0700 Subject: [PATCH] Bug 798303 - account list is sorted wrong by amount Use balances converted to the default currency when sorting columns on the accounts page. --- gnucash/gnome-utils/gnc-tree-view-account.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c index 35c33f2e85..03425bf056 100644 --- a/gnucash/gnome-utils/gnc-tree-view-account.c +++ b/gnucash/gnome-utils/gnc-tree-view-account.c @@ -372,6 +372,7 @@ sort_by_xxx_value (xaccGetBalanceInCurrencyFn fn, gpointer user_data) { const Account *account_a, *account_b; + const gnc_commodity *cur = gnc_default_currency(); gnc_numeric balance_a, balance_b; gint result; @@ -379,8 +380,8 @@ sort_by_xxx_value (xaccGetBalanceInCurrencyFn fn, sort_cb_setup (f_model, f_iter_a, f_iter_b, &account_a, &account_b); /* Get balances */ - balance_a = gnc_ui_account_get_balance_full(fn, account_a, recurse, NULL, NULL); - balance_b = gnc_ui_account_get_balance_full(fn, account_b, recurse, NULL, NULL); + balance_a = gnc_ui_account_get_balance_full(fn, account_a, recurse, NULL, cur); + balance_b = gnc_ui_account_get_balance_full(fn, account_b, recurse, NULL, cur); result = gnc_numeric_compare(balance_a, balance_b); if (result != 0)