gnucash maint: Bug 798303 - account list is sorted wrong by amount
John Ralls
jralls at code.gnucash.org
Sat Sep 11 13:13:29 EDT 2021
Updated via https://github.com/Gnucash/gnucash/commit/b9deb5ea (commit)
from https://github.com/Gnucash/gnucash/commit/d0f7daf4 (commit)
commit b9deb5ea2a870f1568c8342b60a6df9c44772344
Author: John Ralls <jralls at ceridwen.us>
Date: Sat Sep 11 10:11:36 2021 -0700
Bug 798303 - account list is sorted wrong by amount
Use balances converted to the default currency when sorting columns on
the accounts page.
diff --git a/gnucash/gnome-utils/gnc-tree-view-account.c b/gnucash/gnome-utils/gnc-tree-view-account.c
index 35c33f2e8..03425bf05 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)
Summary of changes:
gnucash/gnome-utils/gnc-tree-view-account.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
More information about the gnucash-changes
mailing list