diff options
author | John Wiegley <johnw@newartisans.com> | 2006-03-24 01:41:22 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 02:41:31 -0400 |
commit | 44561c1c1d233d9432de319a71b44a3e05275d49 (patch) | |
tree | 3b9fa53fa4bd0e50e0890f6aafea69533e89832c /walk.cc | |
parent | 964e74e333cb20d3519be64f79e19224f2bcc84e (diff) | |
download | fork-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.cc | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -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); |