mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-04-24 09:38:35 +02:00
fix(insights:emergency-fund): hide untracked accounts
This commit is contained in:
@@ -239,10 +239,14 @@ def late_transactions(request):
|
|||||||
@login_required
|
@login_required
|
||||||
@require_http_methods(["GET"])
|
@require_http_methods(["GET"])
|
||||||
def emergency_fund(request):
|
def emergency_fund(request):
|
||||||
transactions_currency_queryset = Transaction.objects.filter(
|
transactions_currency_queryset = (
|
||||||
is_paid=True, account__is_archived=False, account__is_asset=False
|
Transaction.objects.filter(
|
||||||
).order_by(
|
is_paid=True, account__is_archived=False, account__is_asset=False
|
||||||
"account__currency__name",
|
)
|
||||||
|
.exclude(account__in=request.user.untracked_accounts.all())
|
||||||
|
.order_by(
|
||||||
|
"account__currency__name",
|
||||||
|
)
|
||||||
)
|
)
|
||||||
currency_net_worth = calculate_currency_totals(
|
currency_net_worth = calculate_currency_totals(
|
||||||
transactions_queryset=transactions_currency_queryset, ignore_empty=False
|
transactions_queryset=transactions_currency_queryset, ignore_empty=False
|
||||||
@@ -262,6 +266,7 @@ def emergency_fund(request):
|
|||||||
category__mute=False,
|
category__mute=False,
|
||||||
mute=False,
|
mute=False,
|
||||||
)
|
)
|
||||||
|
.exclude(account__in=request.user.untracked_accounts.all())
|
||||||
.values("reference_date", "account__currency")
|
.values("reference_date", "account__currency")
|
||||||
.annotate(monthly_total=Sum("amount"))
|
.annotate(monthly_total=Sum("amount"))
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user