summaryrefslogtreecommitdiff
path: root/walk.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-03-24 01:41:22 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:31 -0400
commit44561c1c1d233d9432de319a71b44a3e05275d49 (patch)
tree3b9fa53fa4bd0e50e0890f6aafea69533e89832c /walk.cc
parent964e74e333cb20d3519be64f79e19224f2bcc84e (diff)
downloadfork-ledger-44561c1c1d233d9432de319a71b44a3e05275d49.tar.gz
fork-ledger-44561c1c1d233d9432de319a71b44a3e05275d49.tar.bz2
fork-ledger-44561c1c1d233d9432de319a71b44a3e05275d49.zip
Further refinement of commodity lot information.
Diffstat (limited to 'walk.cc')
-rw-r--r--walk.cc29
1 files changed, 28 insertions, 1 deletions
diff --git a/walk.cc b/walk.cc
index 3a8ce640..32c165c2 100644
--- a/walk.cc
+++ b/walk.cc
@@ -528,13 +528,40 @@ void set_comm_as_payee::operator()(transaction_t& xact)
entry_t& entry = entry_temps.back();
entry._date = xact.date();
entry.code = xact.entry->code;
- entry.payee = xact.amount.commodity().symbol();
+
+ if (xact.amount.commodity())
+ entry.payee = xact.amount.commodity().symbol();
+ else
+ entry.payee = "<none>";
xact_temps.push_back(xact);
transaction_t& temp = xact_temps.back();
temp.entry = &entry;
temp.state = xact.state;
temp.flags |= TRANSACTION_BULK_ALLOC;
+
+ entry.add_transaction(&temp);
+
+ item_handler<transaction_t>::operator()(temp);
+}
+
+void set_code_as_payee::operator()(transaction_t& xact)
+{
+ entry_temps.push_back(*xact.entry);
+ entry_t& entry = entry_temps.back();
+ entry._date = xact.date();
+
+ if (! xact.entry->code.empty())
+ entry.payee = xact.entry->code;
+ else
+ entry.payee = "<none>";
+
+ xact_temps.push_back(xact);
+ transaction_t& temp = xact_temps.back();
+ temp.entry = &entry;
+ temp.state = xact.state;
+ temp.flags |= TRANSACTION_BULK_ALLOC;
+
entry.add_transaction(&temp);
item_handler<transaction_t>::operator()(temp);