diff --git a/app/apps/insights/views.py b/app/apps/insights/views.py index f8ea555..1495d05 100644 --- a/app/apps/insights/views.py +++ b/app/apps/insights/views.py @@ -1,10 +1,8 @@ -import decimal -import json from collections import defaultdict from dateutil.relativedelta import relativedelta from django.contrib.auth.decorators import login_required -from django.db.models import Sum, Avg, F +from django.db.models import Sum from django.shortcuts import render from django.utils import timezone from django.views.decorators.http import require_http_methods @@ -22,13 +20,13 @@ from apps.insights.utils.category_explorer import ( get_category_sums_by_account, get_category_sums_by_currency, ) +from apps.insights.utils.category_overview import get_categories_totals from apps.insights.utils.sankey import ( generate_sankey_data_by_account, generate_sankey_data_by_currency, ) from apps.insights.utils.transactions import get_transactions from apps.transactions.models import TransactionCategory, Transaction -from apps.insights.utils.category_overview import get_categories_totals from apps.transactions.utils.calculations import calculate_currency_totals diff --git a/app/templates/insights/fragments/category_overview/index.html b/app/templates/insights/fragments/category_overview/index.html index d57465f..360b2f9 100644 --- a/app/templates/insights/fragments/category_overview/index.html +++ b/app/templates/insights/fragments/category_overview/index.html @@ -1,68 +1,226 @@ {% load i18n %} -
| {% trans 'Category' %} | -{% trans 'Income' %} | -{% trans 'Expense' %} | -{% trans 'Total' %} | -
|---|
| {% if category.name %}{{ category.name }}{% else %}{% trans 'Uncategorized' %}{% endif %} | -
- {% for currency in category.currencies.values %}
- {% if currency.total_income != 0 %}
- -
- {% endif %}
- {% endfor %}
- |
-
- {% for currency in category.currencies.values %}
- {% if currency.total_expense != 0 %}
- -
- {% endif %}
- {% endfor %}
- |
-
- {% for currency in category.currencies.values %}
- {% if currency.total_final != 0 %}
- -
- {% endif %}
- {% endfor %}
- |
+ {% trans 'Category' %} | +{% trans 'Income' %} | +{% trans 'Expense' %} | +{% trans 'Total' %} |
|---|