summaryrefslogtreecommitdiff
path: root/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-02-27 23:52:31 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:27 -0400
commit7901598f1d1e419e19c860e81749805371298030 (patch)
treef3b4b42ad4217cd5a59eafb8cb8ffacea83b60ca /journal.cc
parent4507573d4fbc4ece6a4bb832b2e1fffae0885db8 (diff)
downloadfork-ledger-7901598f1d1e419e19c860e81749805371298030.tar.gz
fork-ledger-7901598f1d1e419e19c860e81749805371298030.tar.bz2
fork-ledger-7901598f1d1e419e19c860e81749805371298030.zip
Checked in all major updates.
Diffstat (limited to 'journal.cc')
-rw-r--r--journal.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/journal.cc b/journal.cc
index 232bb97a..ceedb2c4 100644
--- a/journal.cc
+++ b/journal.cc
@@ -13,6 +13,14 @@ const std::string version = PACKAGE_VERSION;
bool transaction_t::use_effective_date = false;
+transaction_t::~transaction_t()
+{
+ DEBUG_PRINT("ledger.memory.dtors", "dtor transaction_t");
+ if (cost) delete cost;
+ if (amount_expr) amount_expr->release();
+ if (cost_expr) cost_expr->release();
+}
+
std::time_t transaction_t::actual_date() const
{
if (_date == 0 && entry)
@@ -96,6 +104,10 @@ bool entry_base_t::finalize()
} else {
balance += *p;
}
+
+ if ((*x)->cost && (*x)->amount.commodity().price)
+ balance += (*((*x)->amount.commodity().price) * (*x)->amount -
+ *((*x)->cost));
}
}