summaryrefslogtreecommitdiff
path: root/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-09-17 05:05:26 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-09-17 05:05:26 -0400
commit495b64f29646d992deb359c5a5cb7e75e6541a0a (patch)
tree1b614c97e12a88d5657f755352efd737dca2c74d /journal.cc
parentbd46f5af18349abd4e5419fef3c0f55cfcd969f7 (diff)
downloadledger-495b64f29646d992deb359c5a5cb7e75e6541a0a.tar.gz
ledger-495b64f29646d992deb359c5a5cb7e75e6541a0a.tar.bz2
ledger-495b64f29646d992deb359c5a5cb7e75e6541a0a.zip
When automatically associating lot details with a commodity, use only the
price (based on the cost of the transactions), don't automatically use the date and the entry code -- since most people aren't going to be that specific at the time of sale, it's causes confusion in certain cases. Fixes: E87DD3A5-B061-46A0-95E9-9844A6CB0443
Diffstat (limited to 'journal.cc')
-rw-r--r--journal.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/journal.cc b/journal.cc
index 638cce8b..8ff276eb 100644
--- a/journal.cc
+++ b/journal.cc
@@ -177,10 +177,7 @@ bool entry_base_t::finalize()
if ((*x)->amount.commodity() &&
! (*x)->amount.commodity().annotated)
- (*x)->amount.annotate_commodity
- (abs(per_unit_cost),
- entry ? entry->actual_date() : datetime_t(),
- entry ? entry->code : "");
+ (*x)->amount.annotate_commodity(abs(per_unit_cost));
(*x)->cost = new amount_t(- (per_unit_cost * (*x)->amount));
balance += *(*x)->cost;