diff --git a/modules/ing/pages/account_history.py b/modules/ing/pages/account_history.py index 26ba937d..b5795c99 100644 --- a/modules/ing/pages/account_history.py +++ b/modules/ing/pages/account_history.py @@ -39,6 +39,11 @@ class TransactionCC(FrenchTransaction): ] +class TransactionAA(FrenchTransaction): + PATTERNS = [(re.compile(u'^(?PVIREMENT (RECU|EMIS VERS)?) (?P.*)'), FrenchTransaction.TYPE_TRANSFER), + ] + + class AccountHistoryCC(BasePage): def on_loaded(self): self.transactions = [] @@ -72,17 +77,13 @@ class AccountHistoryLA(BasePage): for tr in history: id = i texte = tr.text_content().strip().split('\n') - op = Transaction(id) + op = TransactionAA(id) # The size is not the same if there are two dates or only one length = len(texte) - op.raw = unicode(texte[length - 2].strip()) - op.date = date(*reversed([int(x) for x in texte[0].split('/')])) - op.category = NotAvailable + op.parse(date = date(*reversed([int(x) for x in texte[0].split('/')])), + raw = unicode(texte[length - 2].strip())) - amount = texte[length - 1].replace('\t', '').strip().\ - replace('.', '').replace(u'€', '').\ - replace(',', '.').replace(u'\xa0', u'') - op.amount = Decimal(amount) + op.amount = Decimal(op.clean_amount(texte[length - 1])) self.transactions.append(op) i += 1