Bug 770364 - Sign of Value in Lots in Account window seems inconsistent

Two parts to this bug:
1. never reverse signs in the free splits list. Sign reversals don't
make sense there.

2. Sign reversal only makes sense for capital gains, not for business
transactions. So only to the sign dance for non-business lots in the
list of splits in the selected lot.
pull/111/head
Geert Janssens 10 years ago
parent 5b832c7f9b
commit ecb43e7d72

@ -485,8 +485,12 @@ gnc_split_viewer_fill (GNCLotViewer *lv, GtkListStore *store, SplitList *split_l
{
SplitList *node;
GtkTreeIter iter;
gboolean is_business_lot = FALSE;
gnc_numeric baln = gnc_numeric_zero();
if (lv->selected_lot)
is_business_lot = xaccAccountIsAPARType (xaccAccountGetType (gnc_lot_get_account (lv->selected_lot)));
gtk_list_store_clear (lv->split_in_lot_store);
for (node = split_list; node; node = node->next)
{
@ -501,8 +505,7 @@ gnc_split_viewer_fill (GNCLotViewer *lv, GtkListStore *store, SplitList *split_l
gnc_numeric amnt, valu, gains;
/* Do not show gains splits, however do show empty business splits */
if (!xaccAccountIsAPARType (xaccAccountGetType (xaccSplitGetAccount (split)))
&& gnc_numeric_zero_p (xaccSplitGetAmount(split))) continue;
if (!is_business_lot && gnc_numeric_zero_p (xaccSplitGetAmount(split))) continue;
gtk_list_store_append(store, &iter);
@ -522,13 +525,13 @@ gnc_split_viewer_fill (GNCLotViewer *lv, GtkListStore *store, SplitList *split_l
gnc_account_print_info (lv->account, TRUE));
gtk_list_store_set (store, &iter, SPLIT_COL_AMOUNT, amtbuff, -1);
/* Value. Invert the sign on the first, opening entry. */
/* Value.
* For non-business accounts which are part of a lot,
* invert the sign on the first. */
currency = xaccTransGetCurrency (trans);
valu = xaccSplitGetValue (split);
if (node != split_list)
{
valu = gnc_numeric_neg (valu);
}
if (lv->selected_lot && !is_business_lot && (node != split_list))
valu = gnc_numeric_neg (valu);
xaccSPrintAmount (valbuff, valu,
gnc_commodity_print_info (currency, TRUE));
gtk_list_store_set (store, &iter, SPLIT_COL_VALUE, valbuff, -1);

Loading…
Cancel
Save