v0.2.2: surface skipped transactions in the transactions list
This commit is contained in:
8
app.py
8
app.py
@@ -822,6 +822,9 @@ def transactions_view():
|
||||
spending_by_cat = dict(sorted(spending_by_cat.items(), key=lambda x: x[1], reverse=True))
|
||||
week_label = f"Week {current_week_num} ({week_start.strftime('%b %-d')} – {week_end.strftime('%b %-d')})"
|
||||
|
||||
# Count skipped (reviewed but no category, not ignored) for the banner
|
||||
skipped_count = sum(1 for t in transactions if t.get("reviewed") and not t.get("category") and not t.get("ignored"))
|
||||
|
||||
# Optional filters from query string
|
||||
filter_from = request.args.get("from_date", "")
|
||||
filter_to = request.args.get("to_date", "")
|
||||
@@ -840,7 +843,9 @@ def transactions_view():
|
||||
reviewed = [t for t in reviewed if date_parser.parse(t["date"]).date() <= to_d]
|
||||
except Exception:
|
||||
pass
|
||||
if filter_cat:
|
||||
if filter_cat == "__skipped__":
|
||||
reviewed = [t for t in reviewed if not t.get("category") and not t.get("ignored")]
|
||||
elif filter_cat:
|
||||
reviewed = [t for t in reviewed if t.get("category") == filter_cat]
|
||||
if filter_search:
|
||||
q = filter_search.lower()
|
||||
@@ -862,6 +867,7 @@ def transactions_view():
|
||||
week_label=week_label,
|
||||
month_name=cal_mod.month_name[month],
|
||||
year=year, month=month,
|
||||
skipped_count=skipped_count,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user