From fae2890bef71c73225fc0ca58cf4fb552c9af542 Mon Sep 17 00:00:00 2001 From: Sylvie Ye Date: Tue, 29 Jan 2019 11:21:36 +0100 Subject: [PATCH] [societegenerale] update item condition in iter transaction Transfer transaction can have id '0' when 'statusOperation' is 'INTRADAY', Skip them in history --- modules/societegenerale/pages/accounts_list.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/societegenerale/pages/accounts_list.py b/modules/societegenerale/pages/accounts_list.py index 4b883389af..dbdbc5f98b 100644 --- a/modules/societegenerale/pages/accounts_list.py +++ b/modules/societegenerale/pages/accounts_list.py @@ -257,11 +257,13 @@ class TransactionItemElement(ItemElement): klass = Transaction def obj_id(self): - if not Dict('idOpe')(self): - return + # real transaction id is like: + # /DDMMYYYY/ + if not Dict('idOpe')(self) or Regexp(CleanText(Dict('idOpe')), r'^(\d+)$', default=NotAvailable)(self): + return '' id_op = Regexp(CleanText(Dict('idOpe')), r'(\d+)/')(self) if id_op != '0': - # card summary has id '0' + # card summary has transaction id '0' return id_op def obj_vdate(self): @@ -322,8 +324,11 @@ def next_page(self): class item(TransactionItemElement): def condition(self): + # card summary transaction id is like: + # 0/DDMMYYYY/ conditions = ( - Dict('idOpe')(self) and Regexp(CleanText(Dict('idOpe')), r'(\d+)/')(self) == '0', + Dict('idOpe')(self) and \ + Regexp(CleanText(Dict('idOpe')), r'(\d+)/', default=NotAvailable)(self) == '0', Env('card_number')(self) in Dict('libOpe')(self), Dict('statutOperation')(self) == 'COMPTABILISE', ) -- GitLab