Allow showing only unclassified statement lines

This commit is contained in:
RunasSudo 2023-05-28 12:08:31 +10:00
parent bbd98ee8c4
commit 00fe0ec53d
Signed by: RunasSudo
GPG Key ID: 7234E476BF21C61A
2 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,9 @@ def statement_lines():
if 'account' in request.args: if 'account' in request.args:
statement_lines = statement_lines.where(StatementLine.source_account == request.args['account']) statement_lines = statement_lines.where(StatementLine.source_account == request.args['account'])
if request.args.get('unclassified', '0') == '1':
statement_lines = statement_lines.where(StatementLine.reconciliation == None)
page = db.paginate(statement_lines, per_page=int(request.args.get('per_page', 1000))) page = db.paginate(statement_lines, per_page=int(request.args.get('per_page', 1000)))
return render_template('statements/statement_lines.html', page=page) return render_template('statements/statement_lines.html', page=page)

View File

@ -26,6 +26,9 @@
<div class="flex-grow-1"> <div class="flex-grow-1">
<button type="submit" class="btn btn-outline-secondary" formaction="/statement-lines/reconcile-transfer">Reconcile selected as transfer</button> <button type="submit" class="btn btn-outline-secondary" formaction="/statement-lines/reconcile-transfer">Reconcile selected as transfer</button>
<a href="{{ url_for('statement_lines_import') }}" class="btn btn-outline-secondary">Import statement</a> <a href="{{ url_for('statement_lines_import') }}" class="btn btn-outline-secondary">Import statement</a>
{% if request.args.get('unclassified', '0') != '1' %}
<a href="?unclassified=1" class="btn btn-outline-secondary">Show only unclassified lines</a>
{% endif %}
</div> </div>
<nav class="flex-end"> <nav class="flex-end">
<ul class="pagination"> <ul class="pagination">