summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/textual.cc b/textual.cc
index ab87c7bf..7906cc8f 100644
--- a/textual.cc
+++ b/textual.cc
@@ -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);