mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-11 15:22:55 +02:00
fix: wrong calculations
This commit is contained in:
@@ -163,7 +163,6 @@ def calculate_account_totals(transactions_queryset, ignore_empty=False):
|
|||||||
"account__currency__prefix",
|
"account__currency__prefix",
|
||||||
"account__currency__suffix",
|
"account__currency__suffix",
|
||||||
"account__exchange_currency",
|
"account__exchange_currency",
|
||||||
"id",
|
|
||||||
).annotate(
|
).annotate(
|
||||||
expense_current=Coalesce(
|
expense_current=Coalesce(
|
||||||
Sum(
|
Sum(
|
||||||
|
|||||||
@@ -146,8 +146,13 @@ def yearly_overview_by_account(request, year: int):
|
|||||||
if account:
|
if account:
|
||||||
filter_params["account_id"] = int(account)
|
filter_params["account_id"] = int(account)
|
||||||
|
|
||||||
transactions = Transaction.objects.filter(**filter_params).exclude(
|
transactions = (
|
||||||
Q(category__mute=True) & ~Q(category=None)
|
Transaction.objects.filter(**filter_params)
|
||||||
|
.exclude(Q(category__mute=True) & ~Q(category=None))
|
||||||
|
.order_by(
|
||||||
|
"account__group__name",
|
||||||
|
"account__name",
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
data = calculate_account_totals(transactions)
|
data = calculate_account_totals(transactions)
|
||||||
|
|||||||
Reference in New Issue
Block a user