diff options
Diffstat (limited to 'textual.cc')
-rw-r--r-- | textual.cc | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -251,12 +251,14 @@ xact_t * parse_xact(char * line, account_t * account, per_unit_cost /= xact->amount; if (xact->amount.commodity() && - ! xact->amount.commodity().annotated) - xact->amount.annotate_commodity - (annotation_t - (per_unit_cost, - xact->entry ? optional<datetime_t>(xact->entry->actual_date()) : none, - xact->entry ? optional<string>(xact->entry->code) : none)); + ! xact->amount.commodity().annotated) { + if (xact->entry) + xact->amount.annotate(annotation_t(per_unit_cost, + xact->entry->actual_date(), + xact->entry->code)); + else + xact->amount.annotate(annotation_t(per_unit_cost)); + } DEBUG("ledger.textual.parse", "line " << linenum << ": " << "Total cost is " << *xact->cost); |