diff --git a/conservancy_beancount/reconcile/statement_reconciler.py b/conservancy_beancount/reconcile/statement_reconciler.py index 034d33a..17dc912 100644 --- a/conservancy_beancount/reconcile/statement_reconciler.py +++ b/conservancy_beancount/reconcile/statement_reconciler.py @@ -691,7 +691,19 @@ def main(arglist: Optional[Sequence[str]] = None, entries, _, options = loader.load_file(args.beancount_file) # String concatenation looks bad, but there's no SQL injection possible here # because BQL can't write back to the Beancount files. I hope! - query = f'SELECT filename, META("lineno") AS line, META("bank-statement") AS bank_statement, date, number(cost(position)), payee, ENTRY_META("entity") as entity, ANY_META("check-id") as check_id, narration where account = "{args.account}" and date >= {begin_date} and date <= {end_date}' + query = f""" + SELECT filename, + META("lineno") AS line, + META("bank-statement") AS bank_statement, + date, + number(cost(position)), + payee, + ENTRY_META("entity") as entity, + ANY_META("check-id") as check_id, + narration + WHERE account = "{args.account}" + AND date >= {begin_date} + AND date <= {end_date}""" _, result_rows = run_query(entries, options, query) books_trans = sort_records([standardize_beancount_record(row) for row in result_rows])