From 88bbe4fd1296edefaca67f8eb168cd16ad559aa1 Mon Sep 17 00:00:00 2001 From: Oleksii Sadovyi Date: Sun, 19 Nov 2023 17:18:30 +0200 Subject: [PATCH] Update termination conditions for PUMB and Sense importers Seen these in the latest account statements, perhaps due to the product updates. --- src/uabean/importers/pumb_xls.py | 2 ++ src/uabean/importers/sensebank.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/uabean/importers/pumb_xls.py b/src/uabean/importers/pumb_xls.py index fc7fc27..5e818fc 100755 --- a/src/uabean/importers/pumb_xls.py +++ b/src/uabean/importers/pumb_xls.py @@ -88,6 +88,8 @@ def extract(self, filename, existing_entries=None): None, ) continue + if row[3].value and row[3].value.strip() == "Нет операций": + continue if row[0].value == "ВСЬОГО": break meta = data.new_metadata(filename, i + 1) diff --git a/src/uabean/importers/sensebank.py b/src/uabean/importers/sensebank.py index a517b87..dd4b72d 100755 --- a/src/uabean/importers/sensebank.py +++ b/src/uabean/importers/sensebank.py @@ -70,8 +70,10 @@ def extract(self, filename, existing_entries=None): account = self.account_config[m.group(1)] currency = m.group(2) for row in reader: - if row[0].startswith("Деталізація операцій") or row[0].startswith( - "Дата і час" + if ( + row[0].startswith("Деталізація операцій") + or row[0].startswith("Дата і час") + or row[0].startswith("Вклади гарантуються ") ): continue meta = data.new_metadata(filename, reader.line_num)