From 7a1d0d46146ecdb79a156ea1197bc3f1bd30cb95 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 10 Aug 2004 17:54:47 -0400 Subject: new debug code; automated transactions now use value expression predicates --- autoxact.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'autoxact.cc') diff --git a/autoxact.cc b/autoxact.cc index c49d1d38..7dac4512 100644 --- a/autoxact.cc +++ b/autoxact.cc @@ -4,11 +4,14 @@ namespace ledger { void automated_transaction_t::extend_entry(entry_t * entry) { - for (transactions_list::iterator i = entry->transactions.begin(); - i != entry->transactions.end(); + transactions_deque initial_xacts(entry->transactions.begin(), + entry->transactions.end()); + + for (transactions_deque::iterator i = initial_xacts.begin(); + i != initial_xacts.end(); i++) - if (matches(masks, *((*i)->account))) { - for (transactions_list::iterator t = transactions.begin(); + if (predicate(*i)) + for (transactions_deque::iterator t = transactions.begin(); t != transactions.end(); t++) { amount_t amt; @@ -22,7 +25,6 @@ void automated_transaction_t::extend_entry(entry_t * entry) (*t)->flags | TRANSACTION_AUTO); entry->add_transaction(xact); } - } } } // namespace ledger -- cgit v1.2.3