reconciler: Remove debug warning.

This commit is contained in:
Ben Sturmfels 2022-02-24 21:11:02 +11:00
parent 72385fd0bd
commit 9ae36feed2
Signed by: bsturmfels
GPG key ID: 023C05E2C9C068F0

View file

@ -129,6 +129,11 @@ def read_transactions_from_csv(f: TextIO, standardize_statement_record: Callable
reader = csv.DictReader(f) reader = csv.DictReader(f)
return sort_records([standardize_statement_record(row, reader.line_num) for row in reader]) return sort_records([standardize_statement_record(row, reader.line_num) for row in reader])
# Does the account you entered match the CSV?
# Is the CSV in the format we expect? (ie. did they download through the right interface?)
# Logical CSV line numbers
# CSV reconciliation report
# Merge helper script.
def standardize_amex_record(row: Dict, line: int) -> Dict: def standardize_amex_record(row: Dict, line: int) -> Dict:
"""Turn an AMEX CSV row into a standard dict format representing a transaction.""" """Turn an AMEX CSV row into a standard dict format representing a transaction."""
@ -251,13 +256,10 @@ def records_match(r1: Dict, r2: Dict) -> Tuple[bool, str]:
def match_statement_and_books(statement_trans: list, books_trans: list): def match_statement_and_books(statement_trans: list, books_trans: list):
""" """
Runs through all the statement transactions to find a matching transaction Runs through all the statement transactions to find a matching transaction
in the books. If found, the books transaction is marked off so that it can in the books. If found, the books transaction is marked off so that it can
only be matched once. Some transactions will be matched, some will be on the only be matched once. Some transactions will be matched, some will be on the
statement but not the books and some on the books but not the statement. statement but not the books and some on the books but not the statement.
""" """
matches = [] matches = []
remaining_books_trans = [] remaining_books_trans = []
@ -276,8 +278,6 @@ def match_statement_and_books(statement_trans: list, books_trans: list):
best_match_index = i best_match_index = i
best_match_note = note best_match_note = note
if best_match_score > 0.5 and matches_found == 1 and 'check-id mismatch' not in best_match_note or best_match_score > 0.8: if best_match_score > 0.5 and matches_found == 1 and 'check-id mismatch' not in best_match_note or best_match_score > 0.8:
if best_match_score <= 0.8:
best_match_note.append('only one decent match')
matches.append(([r1], [books_trans[best_match_index]], best_match_note)) matches.append(([r1], [books_trans[best_match_index]], best_match_note))
# Don't try to make a second match against this books entry. # Don't try to make a second match against this books entry.
del books_trans[best_match_index] del books_trans[best_match_index]