Only show budgeted categories on snapshot page
This commit is contained in:
parent
08b3c3dd18
commit
364ad42c05
1 changed files with 2 additions and 3 deletions
|
@ -166,9 +166,8 @@ def snapshot(request, uuid=None):
|
||||||
|
|
||||||
if _snapshot.transactions:
|
if _snapshot.transactions:
|
||||||
context["categories"] = (
|
context["categories"] = (
|
||||||
_snapshot.transactions.values(
|
_snapshot.transactions.filter(category__budget=True)
|
||||||
"category", "category__name", "category__icon"
|
.values("category", "category__name", "category__icon")
|
||||||
)
|
|
||||||
.annotate(
|
.annotate(
|
||||||
sum=models.Sum("value"),
|
sum=models.Sum("value"),
|
||||||
sum_m=models.Sum("value", filter=models.Q(value__lt=0)),
|
sum_m=models.Sum("value", filter=models.Q(value__lt=0)),
|
||||||
|
|
Loading…
Reference in a new issue