Accounts still require both security and currency?

Derek Atkins warlord@MIT.EDU
13 Mar 2001 11:14:36 -0500


Hi,

It looks like the changeover from accounts having both a currency and
a security to just having a commodity is not, yet, complete.  Indeed,
I was having a failure from PrintAmountInternal (see logs below) that
stems from the fact that an account requires at least a currency, and
sometimes both a currency and a security.

I've "fixed" my RPC code so that it sends both a currency and
commodity, but I don't like how I had to do that.  Especially if it's
going to change sometime soon.  Anyways, the only thing that seems to
be failing right now is the fact that when I load an account via RPC,
it fails to maintain share-price information for a current balance.

Other than that, I've got complete read access working (including
starting balances).

-derek

PS: Here is the PrintAmount issue:

Breakpoint 1, PrintAmountInternal (buf=0xbffff1e1 "", val={num = -1, 
      denom = 0}, info=0xbffff098) at gnc-ui-util.c:713
713      PWARN ("Bad numeric.");
(gdb) up
#1  0x80724dc in xaccSPrintAmount (bufp=0xbffff1e0 "$", val={num = -1, 
      denom = 0}, info={commodity = 0x8167ec8, max_decimal_places = 2 '\002', 
      min_decimal_places = 2 '\002', use_separators = 1, use_symbol = 1, 
      use_locale = 1, monetary = 1}) at gnc-ui-util.c:961
961     bufp += PrintAmountInternal(bufp, val, &info);
(gdb) up
#2  0x8098fc4 in gnc_ui_refresh_statusbar () at window-main.c:447
447      xaccSPrintAmount(asset_string, currency_accum->assets,
(gdb) p currency_accum
$1 = (GNCCurrencyAcc *) 0x8286990
(gdb) p *currency_accum
$2 = {currency = 0x0, assets = {num = -1, denom = 0}, profits = {num = 0, 
    denom = 1}}

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available