Ejemplo n.º 1
0
def spending_analysis():
    info_requester = InfoRequestHandler(current_user.id)
    file_info = info_requester.get_file_details()
    if not file_info:
        return redirect(url_for('upload_file'))  # someday need to abstract this
    return render_template('spending_analysis.html',
                           file_info=[file_info[0], file_info[1]],
                           title='Home',
                           today=date.today(),
                           annual_budget=info_requester.get_budget_for(category_type='expense') * 12,
                           spending_summary_info=info_requester.get_freq_summary_spending_info())
Ejemplo n.º 2
0
def index():
    if 'categories_to_be_examined' not in session:
        session['categories_to_be_examined'] = []
    info_requester = InfoRequestHandler(current_user.id)
    file_info = info_requester.get_file_details()
    if not file_info:
        return redirect(url_for('upload_file'))  # someday need to abstract this
    return render_template('index.html',
                           file_info=[file_info[0], file_info[1]],
                           title='Home',
                           today=date.today(),
                           annual_budget=info_requester.get_budget_for(category_type='expense') * 12,
                           topline_spending_summary=info_requester.get_top_line_spending_info(),
                           overspent_cat_metadata_by_summary_tag=
                           info_requester.get_overspent_cat_metadata_by_summary_tag(),
                           categories_by_state=info_requester.get_categories_by_current_state())