Skip to content

Commit

Permalink
Sort bank accounts by last imported date
Browse files Browse the repository at this point in the history
Also ensure newly added accounts end up on the bottom.
  • Loading branch information
FestplattenSchnitzel committed May 28, 2024
1 parent 56d283f commit 5198d43
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web/blueprints/finance/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def bank_accounts_list_json() -> ResponseReturnValue:
last_imported_at=(
str(datetime.date(i))
if (i := bank_account.last_imported_at) is not None
else "nie"
else "-"
),
)
for bank_account in get_all_bank_accounts(session)
Expand Down
6 changes: 6 additions & 0 deletions web/blueprints/finance/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ def toolbar(self) -> HasDunderStr | None:
href = url_for(".bank_accounts_create")
return button_toolbar(gettext("Neues Bankkonto anlegen"), href)

class Meta:
table_args = {
"data-sort-order": "desc",
"data-sort-name": "last_imported_at",
}


class BankAccountRow(BaseModel):
name: str
Expand Down

0 comments on commit 5198d43

Please sign in to comment.