summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-17 21:26:41 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-17 21:26:41 -0400
commitb2258cedd17027b2f32514dd4e0c5ba66b3d38c3 (patch)
tree125a7b952106ce64227b78d4428542175b837ec4
parent30fb235841276f32c233bc8d41369a937d1f32be (diff)
downloadfork-ledger-b2258cedd17027b2f32514dd4e0c5ba66b3d38c3.tar.gz
fork-ledger-b2258cedd17027b2f32514dd4e0c5ba66b3d38c3.tar.bz2
fork-ledger-b2258cedd17027b2f32514dd4e0c5ba66b3d38c3.zip
slanack: The problem was that <split:quantity> received the `transaction
commodity' instead of the correct `account commodity'. There should really be a check if the account commodity has been defined.
-rw-r--r--gnucash.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/gnucash.cc b/gnucash.cc
index 0eb10219..7d31526d 100644
--- a/gnucash.cc
+++ b/gnucash.cc
@@ -162,13 +162,9 @@ static void endElement(void *userData, const char *name)
// the transaction is worth.
amount_t value;
commodity_t * default_commodity = NULL;
- if (entry_comm) {
- default_commodity = entry_comm;
- } else {
- account_comm_map::iterator ac = account_comms.find(xact->account);
- if (ac != account_comms.end())
- default_commodity = (*ac).second;
- }
+ account_comm_map::iterator ac = account_comms.find(xact->account);
+ if (ac != account_comms.end())
+ default_commodity = (*ac).second;
if (default_commodity) {
curr_quant.set_commodity(*default_commodity);