From c982a99c1a12c8672d424013041e4fb65f139641 Mon Sep 17 00:00:00 2001 From: Maxime Pommier Date: Thu, 23 May 2019 19:27:37 +0200 Subject: [PATCH] [caissedepargne] Skip card that have no history/coming information and no existing check account Closes: 41708@sibi --- modules/caissedepargne/pages.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index 99f82ca3b9..aeab515597 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -867,6 +867,23 @@ def obj_coming(self): raise SkipItem('immediate debit card?') return CleanDecimal.French(TableCell('coming'), sign=lambda x: -1)(self) + def condition(self): + immediate_str = '' + # There are some card without any information. To exclude them, we keep only account + # with extra "option" (ex: coming transaction link, block bank card...) + if 'Faire opposition' in CleanText("./td[5]")(self): + # Only deferred card have this option to see coming transaction, even when + # there is 0 coming (Table element have no thead for the 5th column). + if 'Consulter mon encours carte' in CleanText("./td[5]")(self): + return True + + # Card without 'Consulter mon encours carte' are immediate card. There are logged + # for now to make the debug easier + immediate_str = '[Immediate card]' + + self.logger.warning('Skip card %s (no history/coming information) %s', Field('number')(self), immediate_str) + return False + class CardsComingPage(IndexPage): def is_here(self): -- GitLab