mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
fix bug
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6624 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -100,6 +100,7 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type)
|
||||
{
|
||||
GNCReconcileList *list;
|
||||
gboolean include_children;
|
||||
GList *accounts;
|
||||
|
||||
g_return_val_if_fail(account, NULL);
|
||||
g_return_val_if_fail((type == RECLIST_DEBIT) ||
|
||||
@@ -115,22 +116,23 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type)
|
||||
xaccQuerySetBook(list->query, gnc_get_current_book ());
|
||||
|
||||
/* match the account */
|
||||
xaccQueryAddSingleAccountMatch(list->query, account, QUERY_OR);
|
||||
accounts = g_list_prepend (NULL, account);
|
||||
|
||||
include_children = xaccAccountGetReconcileChildrenStatus(account);
|
||||
if(include_children)
|
||||
if (include_children)
|
||||
{
|
||||
/* match child accounts */
|
||||
AccountGroup *account_group = xaccAccountGetChildren(account);
|
||||
GList *children_list = xaccGroupGetSubAccounts(account_group);
|
||||
GList *node;
|
||||
GList *children = xaccGroupGetSubAccounts(account_group);
|
||||
|
||||
for (node = children_list; node; node = node->next)
|
||||
xaccQueryAddSingleAccountMatch (list->query, node->data, QUERY_OR);
|
||||
children = g_list_copy (children);
|
||||
|
||||
g_list_free (children_list);
|
||||
accounts = g_list_concat (accounts, children);
|
||||
}
|
||||
|
||||
xaccQueryAddAccountMatch (list->query, accounts, ACCT_MATCH_ANY, QUERY_AND);
|
||||
|
||||
g_list_free (accounts);
|
||||
|
||||
if (type == RECLIST_CREDIT)
|
||||
DxaccQueryAddValueMatch(list->query, 0.0, AMT_SGN_MATCH_CREDIT,
|
||||
AMT_MATCH_ATLEAST, QUERY_AND);
|
||||
|
||||
Reference in New Issue
Block a user