summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-07-31 05:05:24 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-07-31 05:05:24 -0400
commit8afd926a27af55862ce360970e05d747f249a0da (patch)
tree3d93c3bedca21da06681bf9868fa3b94ac5050af /textual.cc
parent8276b51f5692796bfdf75dd64f709e0de1c7caaf (diff)
downloadledger-8afd926a27af55862ce360970e05d747f249a0da.tar.gz
ledger-8afd926a27af55862ce360970e05d747f249a0da.tar.bz2
ledger-8afd926a27af55862ce360970e05d747f249a0da.zip
Cleaned up some method names and documentation relating to values.
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);