Commit 48b4e42b authored by Maxime Gasselin's avatar Maxime Gasselin Committed by Romain Bignon

[creditmutuel] skip withdraw in deferred card history

These transactions are also present on the associated checking account.
Moreover, these tranactions do not have to be in present in the deferred card
history.

Closes: 9816@zendesk
parent 82b859ec
......@@ -901,7 +901,9 @@ class CardPage2(CardPage, HTMLPage, XMLPage):
return not CleanText('//td[contains(., "Aucun mouvement")]', default=False)(self) or not CleanText('//td[contains(., "Aucune opération")]', default=False)(self)
class item(Transaction.TransactionElement):
condition = lambda self: len(self.el.xpath('./td')) >= 4
def condition(self):
# Withdraw transactions are also presents on the checking account
return len(self.el.xpath('./td')) >= 4 and not CleanText(TableCell('commerce'))(self).startswith('RETRAIT CB')
obj_raw = Transaction.Raw(Format("%s %s", CleanText(TableCell('commerce')), CleanText(TableCell('ville'))))
obj_rdate = Field('vdate')
......@@ -949,7 +951,7 @@ class CardPage2(CardPage, HTMLPage, XMLPage):
class item(Transaction.TransactionElement):
def condition(self):
return len(self.el.xpath('./td')) >= 4
return len(self.el.xpath('./td')) >= 4 and not CleanText(TableCell('operation'))(self).startswith('RETRAIT CB')
obj_label = CleanText(TableCell('operation'))
......@@ -979,6 +981,10 @@ class CardPage2(CardPage, HTMLPage, XMLPage):
col_ville = 'Ville'
class item(Transaction.TransactionElement):
def condition(self):
# Withdraw transactions are also presents on the checking account
return not CleanText(TableCell('commerce'))(self).startswith('RETRAIT CB')
obj_raw = Transaction.Raw(Format("%s %s", CleanText(TableCell('commerce')), CleanText(TableCell('ville'))))
obj_rdate = Field('vdate')
obj_date = Env('date')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment