From 04c105e2bff66280711bd943554ce454a1fe0cd9 Mon Sep 17 00:00:00 2001 From: Tiago Amaral Date: Thu, 27 Jun 2024 17:48:41 -0300 Subject: [PATCH] [IMP] first line without date --- .../models/account_statement_import_sheet_parser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/account_statement_import_txt_xlsx/models/account_statement_import_sheet_parser.py b/account_statement_import_txt_xlsx/models/account_statement_import_sheet_parser.py index 1d56b6ab8..0ba6b3d85 100644 --- a/account_statement_import_txt_xlsx/models/account_statement_import_sheet_parser.py +++ b/account_statement_import_txt_xlsx/models/account_statement_import_sheet_parser.py @@ -61,7 +61,9 @@ def parse(self, data_file, mapping, filename): lines = self._parse_lines(mapping, data_file, currency_code) if not lines: return currency_code, account_number, [{"transactions": []}] - + if not isinstance(lines[0]["timestamp"], datetime): + if lines[0]["description"] and lines[0]["balance"]: + lines[0]["timestamp"] = lines[1]["timestamp"] lines = list(sorted(lines, key=lambda line: line["timestamp"])) first_line = lines[0] last_line = lines[-1]