summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/textual.cc8
-rw-r--r--test/regress/86D2BDC4.test12
2 files changed, 19 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);
diff --git a/test/regress/86D2BDC4.test b/test/regress/86D2BDC4.test
new file mode 100644
index 00000000..8cd51e42
--- /dev/null
+++ b/test/regress/86D2BDC4.test
@@ -0,0 +1,12 @@
+reg -B
+<<<
+2009/06/03 Westjet
+ Expenses:Transportation:Air C$429.80 @ 1.572865
+ Expenses:Bank:Fees 2.73
+ Liabilities:Mastercard
+>>>1
+09-Jun-03 Westjet Ex:Transportation:Air 676.017377 676.017377
+ Expenses:Bank:Fees 2.73 678.747377
+ Liabilities:Mastercard -678.747377 0
+>>>2
+=== 0