r18320 - gnucash/trunk/src/register/ledger-core - Bug #585784: Fix wrong fractional precision in stock/mutual fund registers Bug 585784 - Wrong fractional precision displayed in stock/mutual fund registers

Christian Stimming cstim at code.gnucash.org
Fri Sep 18 15:50:49 EDT 2009


Author: cstim
Date: 2009-09-18 15:50:48 -0400 (Fri, 18 Sep 2009)
New Revision: 18320
Trac: http://svn.gnucash.org/trac/changeset/18320

Modified:
   gnucash/trunk/src/register/ledger-core/split-register-model.c
Log:
Bug #585784: Fix wrong fractional precision in stock/mutual fund registers Bug 585784 -  Wrong fractional precision displayed in stock/mutual fund registers

The original patch attempted to fix bug #529494 by replacing the
gnc_split_value_print_info function with gnc_split_register_print_info, which
instead of using the print info of the transaction's commodity, used the print
info of the commodity of the register's account.  However, this was not the
correct behavior in all cases either.  This patch eliminates the
gnc_split_register_print_info and instead puts the logic for selecting the
appropriate print info into the functions which previously called it.

* In gnc_split_register_get_balance_entry, the print info of the account of
the split is used (xaccSplitGetAccount); if the split doesn't have an account,
the print info of the register's default account
(gnc_split_register_get_default_account) is used

* In gnc_split_register_get_debcred_entry, if there is no split, the account
info of the register's default account (gnc_split_register_get_default_account)
is used.  Otherwise, if the register is a Stock/Mutual Fund register or an
(obsolete) Currency register, the print info of the transaction's currency is
used (xaccTransGetCurrency).  Finally in all other cases, the print info of the
register's default account (gnc_split_register_get_default_account) is used.

* In gnc_template_register_get_debcred_entry, there is no account to reference,
so the default print info (gnc_default_print_info) is used.

Patch by Daniel Harding.



More information about the gnucash-patches mailing list