diff options
author | John Wiegley <johnw@newartisans.com> | 2009-06-18 16:10:08 +0100 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-06-18 16:10:08 +0100 |
commit | 4253c2a35dc3592d9d31a7ebf270ea4fa3c63e38 (patch) | |
tree | 821b0ef6ad1b3210a35ff640b74b8c403712f8f3 /src | |
parent | 8d97adec7bcba851dcf3e1d659767e7bf8de20ca (diff) | |
download | fork-ledger-4253c2a35dc3592d9d31a7ebf270ea4fa3c63e38.tar.gz fork-ledger-4253c2a35dc3592d9d31a7ebf270ea4fa3c63e38.tar.bz2 fork-ledger-4253c2a35dc3592d9d31a7ebf270ea4fa3c63e38.zip |
Allow uncommoditized amounts to be used as costs
Diffstat (limited to 'src')
-rw-r--r-- | src/textual.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/textual.cc b/src/textual.cc index f2996a03..3cf3c13c 100644 --- a/src/textual.cc +++ b/src/textual.cc @@ -969,8 +969,14 @@ post_t * instance_t::parse_post(char * line, post->cost->in_place_unround(); - if (per_unit) + if (per_unit) { + // For the sole case where the cost might be uncommoditized, + // guarantee that the commodity of the cost after multiplication + // is the same as it was before. + commodity_t& cost_commodity(post->cost->commodity()); *post->cost *= post->amount; + post->cost->set_commodity(cost_commodity); + } DEBUG("textual.parse", "line " << linenum << ": " << "Total cost is " << *post->cost); |