From 5c17da657283ab074cd5d3d45833f6afbaf9ed2d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 19 Jan 2009 22:25:12 -0400 Subject: Instead of doing price annotations in the textual parser, use commodity_t::exchange. --- src/textual.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/textual.cc b/src/textual.cc index ce1db3a3..7dd8c3d6 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -284,9 +284,8 @@ xact_t * parse_xact(char * line, account_t * account, entry_t * entry = NULL) else per_unit_cost /= xact->amount; - if (xact->amount.commodity() && - ! xact->amount.commodity().annotated) - xact->amount.annotate(annotation_t(per_unit_cost)); + commodity_t::exchange(xact->amount.commodity(), + per_unit_cost, datetime_t(*xact->date())); DEBUG("textual.parse", "line " << linenum << ": " << "Total cost is " << *xact->cost); -- cgit v1.2.3