From 72385fd0bd6417425a523338b7e96788c918817c 2022-02-24 09:58:04 From: Ben Sturmfels Date: 2022-02-24 09:58:04 Subject: [PATCH] reconcile: Quote metadata, fix hiding of matched + reconciled lines. --- diff --git a/conservancy_beancount/reconcile/statement_reconciler.py b/conservancy_beancount/reconcile/statement_reconciler.py index 9d247f7a68f0db6a1da078cf95c64b381545c6bb..df52a99644841bf12b3a511bd7e668a00c4a4d50 100644 --- a/conservancy_beancount/reconcile/statement_reconciler.py +++ b/conservancy_beancount/reconcile/statement_reconciler.py @@ -294,7 +294,7 @@ def format_matches(matches, csv_statement: str, show_reconciled_matches): note = ', '.join(note) note = ': ' + note if note else note if r1s and r2s: - if show_reconciled_matches and all(x['bank_statement'] for x in r2s): + if show_reconciled_matches or not all(x['bank_statement'] for x in r2s): if len(r2s) == 1: match_output.append([r1s[0]['date'], f'{format_record(r1s[0])} → {format_record(r2s[0])} ✓ Matched{note}']) else: @@ -322,8 +322,8 @@ def metadata_for_match(match, statement_filename, csv_filename): for books_entry in books_entries: for statement_entry in statement_entries: if not books_entry['bank_statement']: - metadata.append((books_entry['filename'], books_entry['line'], f' bank-statement: {statement_filename}')) - metadata.append((books_entry['filename'], books_entry['line'], f' bank-statement-csv: {csv_filename}:{statement_entry["line"]}')) + metadata.append((books_entry['filename'], books_entry['line'], f' bank-statement: "{statement_filename}"')) + metadata.append((books_entry['filename'], books_entry['line'], f' bank-statement-csv: "{csv_filename}:{statement_entry["line"]}"')) return metadata