def index(): """Show all the transaction""" current_month = utils.get_first_day_of_month() last_month = utils.substract_months(current_month, 1) start = utils.get_first_day_of_month(last_month.year, last_month.month) end = datetime.date.today() transactions = Transaction.getTransactions(start, end) transactions.reverse() return render_template('transactions/index.html', transactions=transactions)
def get_latest_transaction_by_rule(id, start=None): """Get a specific rule by id. :param id: id of the rule :return: the complete rule. :rause 404: if a rule with the given id does not exist """ if start is None: start = utils.get_first_day_of_month() transaction = get_db().execute( 'SELECT * FROM transactions WHERE rule_id = ? AND days < ? ORDER BY id DESC LIMIT 1', (id, start)).fetchone() return transaction
def start(self): return self._kwargs.get("start", utils.get_first_day_of_month())
def custom_overview(year, month, month_count): return createOverview( utils.get_first_day_of_month(year, month), utils.add_months(utils.get_last_day_of_month(year, month), (month_count - 1)))
def month_overview(year, month): return createOverview(utils.get_first_day_of_month(year, month), utils.get_last_day_of_month(year, month))
def year_overview(year): return createOverview(utils.get_first_day_of_month(year, 1), utils.get_last_day_of_month(year, 12))
def index(): return createOverview(utils.get_first_day_of_month(), utils.get_last_day_of_month())