tweak dialog for a many-to-one mapping

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9251 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas 2003-09-07 03:13:06 +00:00
parent f61704ccc6
commit 37f9077d68

View File

@ -67,6 +67,13 @@ gnc_split_register_balance_trans (SplitRegister *reg, Transaction *trans)
split = xaccTransGetSplit (trans, 0); split = xaccTransGetSplit (trans, 0);
other_split = xaccSplitGetOtherSplit (split); other_split = xaccSplitGetOtherSplit (split);
if (other_split == NULL)
{
/* Attempt to handle the inverted many-to-one mapping */
split = xaccTransGetSplit (trans, 1);
if (split) other_split = xaccSplitGetOtherSplit (split);
else split = xaccTransGetSplit (trans, 0);
}
if (other_split == NULL) if (other_split == NULL)
{ {
two_accounts = FALSE; two_accounts = FALSE;
@ -104,11 +111,13 @@ gnc_split_register_balance_trans (SplitRegister *reg, Transaction *trans)
radio_list = g_list_append (radio_list, radio_list = g_list_append (radio_list,
_("Adjust current account split total")); _("Adjust current account split total"));
default_value = 2;
if (two_accounts) if (two_accounts)
{
radio_list = g_list_append (radio_list, radio_list = g_list_append (radio_list,
_("Adjust other account split total")); _("Adjust other account split total"));
default_value = 3;
default_value = 2; }
} }
else else
default_value = 0; default_value = 0;