Merge pull request #174

feat(insights:category-explorer): allow for uncategorized totals
This commit is contained in:
Herculino Trotta
2025-02-18 20:45:24 -03:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ from apps.common.widgets.datepicker import (
AirDatePickerInput,
)
from apps.transactions.models import TransactionCategory
from apps.common.widgets.tom_select import TomSelect
class SingleMonthForm(forms.Form):
@@ -115,7 +116,9 @@ class CategoryForm(forms.Form):
category = forms.ModelChoiceField(
required=False,
label=_("Category"),
empty_label=_("Uncategorized"),
queryset=TransactionCategory.objects.filter(active=True),
widget=TomSelect(clear_button=True),
)
def __init__(self, *args, **kwargs):

View File

@@ -126,7 +126,7 @@ def category_sum_by_account(request):
# Generate data
account_data = get_category_sums_by_account(transactions, category)
else:
account_data = None
account_data = get_category_sums_by_account(transactions, category=None)
return render(
request,
@@ -150,9 +150,7 @@ def category_sum_by_currency(request):
# Generate data
currency_data = get_category_sums_by_currency(transactions, category)
else:
currency_data = None
print(currency_data)
currency_data = get_category_sums_by_currency(transactions, category=None)
return render(
request,