summaryrefslogtreecommitdiff
path: root/item.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-07-27 01:33:41 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-07-27 01:33:41 -0400
commitdd5680c2674fe9ce458941ec9b3978cd7dda9bff (patch)
tree6f54757768b36ef3ab9590d490f1c96e4b798c11 /item.cc
parent161d6f79bd6f4ab45afa1cbae77548c8e508809a (diff)
downloadfork-ledger-dd5680c2674fe9ce458941ec9b3978cd7dda9bff.tar.gz
fork-ledger-dd5680c2674fe9ce458941ec9b3978cd7dda9bff.tar.bz2
fork-ledger-dd5680c2674fe9ce458941ec9b3978cd7dda9bff.zip
reorganized report.cc into item.cc, expr.cc and format.cc
Diffstat (limited to 'item.cc')
-rw-r--r--item.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/item.cc b/item.cc
index 7e45ab07..37242659 100644
--- a/item.cc
+++ b/item.cc
@@ -1,4 +1,6 @@
#include "item.h"
+#include "constraint.h"
+#include "expr.h"
namespace ledger {
@@ -11,7 +13,7 @@ item_t * walk_accounts(const account_t * account,
{
item_t * item = new item_t;
item->account = account;
- item->date = end_date(constraints);
+ item->date = constraints.end();
for (constrained_transactions_list_const_iterator
i(account->transactions.begin(),
@@ -85,8 +87,7 @@ item_t * walk_items(const item_t * top,
item_t * walk_entries(entries_list::const_iterator begin,
entries_list::const_iterator end,
- const constraints_t& constraints,
- const format_t& format)
+ const constraints_t& constraints)
{
#if 0
int last_mon = -1;
@@ -113,7 +114,7 @@ item_t * walk_entries(entries_list::const_iterator begin,
item->payee = (*i)->payee;
}
- if (! format.show_inverted) {
+ if (! constraints.show_inverted) {
item_t * subitem = new item_t;
subitem->parent = item;
subitem->date = item->date;
@@ -122,7 +123,7 @@ item_t * walk_entries(entries_list::const_iterator begin,
item->subitems.push_back(subitem);
}
- if (format.show_related)
+ if (constraints.show_related)
for (transactions_list::iterator k = (*i)->transactions.begin();
k != (*i)->transactions.end();
k++)
@@ -132,7 +133,7 @@ item_t * walk_entries(entries_list::const_iterator begin,
subitem->date = item->date;
subitem->account = (*k)->account;
subitem->value = *(*k);
- if (format.show_inverted)
+ if (constraints.show_inverted)
subitem->value.negate();
item->subitems.push_back(subitem);
}