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

[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 @@ def condition(self): ...@@ -901,7 +901,9 @@ def condition(self):
return not CleanText('//td[contains(., "Aucun mouvement")]', default=False)(self) or not CleanText('//td[contains(., "Aucune opération")]', default=False)(self) 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): 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_raw = Transaction.Raw(Format("%s %s", CleanText(TableCell('commerce')), CleanText(TableCell('ville'))))
obj_rdate = Field('vdate') obj_rdate = Field('vdate')
...@@ -949,7 +951,7 @@ def condition(self): ...@@ -949,7 +951,7 @@ def condition(self):
class item(Transaction.TransactionElement): class item(Transaction.TransactionElement):
def condition(self): 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')) obj_label = CleanText(TableCell('operation'))
...@@ -979,6 +981,10 @@ class list_history(Transaction.TransactionsElement): ...@@ -979,6 +981,10 @@ class list_history(Transaction.TransactionsElement):
col_ville = 'Ville' col_ville = 'Ville'
class item(Transaction.TransactionElement): 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_raw = Transaction.Raw(Format("%s %s", CleanText(TableCell('commerce')), CleanText(TableCell('ville'))))
obj_rdate = Field('vdate') obj_rdate = Field('vdate')
obj_date = Env('date') 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