def testmatches(self, filter_id): u = accounts.user(cherrypy.request.login) f = accounts.importfilters(u) f.load_test_filter(u.id, filter_id) transactions = [] for a in u.get_accounts(): for t in a.get_transactions(): if f.testmatch(t): transactions.append(t) return serve_template('/management/importfilters/testmatches.html', self, matches=transactions)
def import1(self, accid): """begin import system for importing data into an account""" self.page = htmlobjects.Page('Import Account') return serve_template('account/import1.html', self, accid=accid, profiles=[{'id': p, 'name': p} for p in accounts.importprofile.profiles.keys()])
def view(self, accid, description=None, category=None): acc = accounts.account(accid) _page = htmlobjects.Page(acc.name, "{} {}".format(acc.number, acc.sortcode)) return serve_template('account/view.html', _page, transactions=acc.get_transactions(description, category), categories=accounts.transaction.get_categories())
def new(self): self.page = htmlobjects.Page('New Account') return serve_template('account/new.html', self, profiles=[{'id': p, 'name': p} for p in accounts.importprofile.profiles.keys()])
def index(self, query): user = accounts.user(cherrypy.request.login) transactions = accounts.account.search_transactions(user, query) return serve_template('search/index.html', self, transactions=transactions, categories=accounts.transaction.get_categories())
def index(self): user = accounts.user(cherrypy.request.login) return serve_template('index.html', self, accounts=user.get_accounts())
def monthly_change(self): u = accounts.user(cherrypy.request.login) months, data = accounts.reports.monthly_change(u.id) return serve_template('/reports/monthly_change.html', self, months=months, data=data, categories=accounts.transaction.category_lookup())
def category_totals(self): u = accounts.user(cherrypy.request.login) return serve_template('/reports/category_totals.html', self, totals=accounts.reports.category_totals(u.id))
def index(self): return serve_template('/reports/index.html', self)
def edit(self, filter_id): return serve_template('/management/importfilters/edit.html', self, positions=accounts.importfilters.filter.positions.keys(), fields=accounts.importfilters.filter.fields, categories=accounts.transaction.get_categories(), f=accounts.importfilters.get_one(filter_id))
def new(self, pattern=''): return serve_template('/management/importfilters/new.html', self, pattern=pattern, positions=accounts.importfilters.filter.positions.keys(), fields=accounts.importfilters.filter.fields, categories=accounts.transaction.get_categories())
def index(self): u = accounts.user(cherrypy.request.login) filters = accounts.importfilters.get_all(u.id) return serve_template('/management/importfilters/index.html', self, filters=filters)
def new(self): return serve_template('/management/transactiontypes/new.html', self, categories=accounts.transaction.get_categories())
def index(self): ttypes = accounts.transaction.types.get_all() return serve_template('/management/transactiontypes/index.html', self, types=ttypes)
def index(self): return serve_template('/management/index.html', self)