r19925 - gnucash/trunk/src/register/ledger-core - If you have a parent account with a subaccount whose commodity allows more

Mike Alexander mta at code.gnucash.org
Sat Dec 11 23:26:57 EST 2010


Author: mta
Date: 2010-12-11 23:26:56 -0500 (Sat, 11 Dec 2010)
New Revision: 19925
Trac: http://svn.gnucash.org/trac/changeset/19925

Modified:
   gnucash/trunk/src/register/ledger-core/split-register-util.c
Log:
If you have a parent account with a subaccount whose commodity allows more
decimal places in the amount field than the parent account does things
don't work right if you open a register for the parent account and all
subaccounts.  This situation can occur if you have a broker account with
subaccounts for the securities held in that broker account. If you open a
register for the top account and all subaccounts, it is impossible to enter
a transaction to buy or sell a fractional share of the security where there
are more digits after the decimal point than the parent account allows.
This change fixes this if the subaccount allows no more than six digits
after the decimal point.

Modified: gnucash/trunk/src/register/ledger-core/split-register-util.c
===================================================================
--- gnucash/trunk/src/register/ledger-core/split-register-util.c	2010-12-10 13:09:50 UTC (rev 19924)
+++ gnucash/trunk/src/register/ledger-core/split-register-util.c	2010-12-12 04:26:56 UTC (rev 19925)
@@ -360,16 +360,13 @@
 
     account = xaccSplitGetAccount (split);
 
-    if (account == NULL)
-        account = gnc_split_register_get_default_account (reg);
-
     cell = (PriceCell *) gnc_table_layout_get_cell (reg->table->layout,
             SHRS_CELL);
 
     if (account)
         gnc_price_cell_set_fraction (cell, xaccAccountGetCommoditySCU (account));
     else
-        gnc_price_cell_set_fraction (cell, 100000);
+        gnc_price_cell_set_fraction (cell, 1000000);
 }
 
 CellBlock *



More information about the gnucash-changes mailing list