diff options
author | John Wiegley <johnw@newartisans.com> | 2006-03-16 11:58:44 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:30 -0400 |
commit | b1a04923fefdc83387b776b6684188ce2175bfc4 (patch) | |
tree | 0ee386b33da1d30d7e1a63a0f02cfaf764f75e4b /textual.cc | |
parent | 2964dd15b24787162c53560ae9ceae5a92cfc86d (diff) | |
download | fork-ledger-b1a04923fefdc83387b776b6684188ce2175bfc4.tar.gz fork-ledger-b1a04923fefdc83387b776b6684188ce2175bfc4.tar.bz2 fork-ledger-b1a04923fefdc83387b776b6684188ce2175bfc4.zip |
*** empty log message ***
Diffstat (limited to 'textual.cc')
-rw-r--r-- | textual.cc | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -229,16 +229,19 @@ transaction_t * parse_transaction(char * line, account_t * account, else per_unit_cost /= xact->amount; - if (! xact->amount.commodity().annotated) { - xact->amount.annotate_commodity(per_unit_cost, - xact->entry->actual_date(), - xact->entry->code); - } else { - annotated_commodity_t& ann(static_cast<annotated_commodity_t&> - (xact->amount.commodity())); - xact->amount.annotate_commodity(! ann.price ? per_unit_cost : amount_t(), - ! ann.date ? xact->entry->actual_date() : 0, - ann.tag.empty() ? xact->entry->code : ""); + if (xact->amount.commodity()) { + if (! xact->amount.commodity().annotated) { + xact->amount.annotate_commodity(per_unit_cost, + xact->entry->actual_date(), + xact->entry->code); + } else { + annotated_commodity_t& ann(static_cast<annotated_commodity_t&> + (xact->amount.commodity())); + xact->amount.annotate_commodity + (! ann.price ? per_unit_cost : amount_t(), + ! ann.date ? xact->entry->actual_date() : 0, + ann.tag.empty() ? xact->entry->code : ""); + } } DEBUG_PRINT("ledger.textual.parse", "line " << linenum << ": " << |