Add the new field for Compte Courant
This commit is contained in:
parent
535aee9a71
commit
54ad584f4c
2 changed files with 20 additions and 9 deletions
|
|
@ -89,7 +89,7 @@ class Ing(BaseBrowser):
|
||||||
self.location('https://secure.ingdirect.fr/general?command=goToAccount&account=%d&zone=COMPTE' % int(id))
|
self.location('https://secure.ingdirect.fr/general?command=goToAccount&account=%d&zone=COMPTE' % int(id))
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
return self.page.get_operations()
|
return self.page.get_transactions()
|
||||||
|
|
||||||
# TODO
|
# TODO
|
||||||
# def get_coming_operations
|
# def get_coming_operations
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,19 @@ from weboob.capabilities.base import NotAvailable
|
||||||
__all__ = ['AccountHistoryCC', 'AccountHistoryLA']
|
__all__ = ['AccountHistoryCC', 'AccountHistoryLA']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AccountHistoryCC(BasePage):
|
class AccountHistoryCC(BasePage):
|
||||||
|
types = {
|
||||||
|
'Carte achat': Transaction.TYPE_CARD,
|
||||||
|
'Virement': Transaction.TYPE_TRANSFER,
|
||||||
|
'Carte retrait': Transaction.TYPE_WITHDRAWAL,
|
||||||
|
u'Prélèvement': Transaction.TYPE_ORDER,
|
||||||
|
'Autre': Transaction.TYPE_UNKNOWN,
|
||||||
|
}
|
||||||
|
|
||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
self.operations = []
|
self.transactions = []
|
||||||
table = self.document.findall('//tbody')[0]
|
table = self.document.findall('//tbody')[0]
|
||||||
i = 1
|
i = 1
|
||||||
for tr in table.xpath('tr'):
|
for tr in table.xpath('tr'):
|
||||||
|
|
@ -38,22 +47,24 @@ class AccountHistoryCC(BasePage):
|
||||||
texte = tr.text_content().split('\n')
|
texte = tr.text_content().split('\n')
|
||||||
op = Transaction(id)
|
op = Transaction(id)
|
||||||
op.label = texte[2]
|
op.label = texte[2]
|
||||||
|
op.raw = texte[2] # nothing to parse
|
||||||
op.date = date(*reversed([int(x) for x in texte[0].split('/')]))
|
op.date = date(*reversed([int(x) for x in texte[0].split('/')]))
|
||||||
op.category = texte[4]
|
op.category = texte[4]
|
||||||
|
op.type = self.types.get(texte[4], Transaction.TYPE_UNKNOWN)
|
||||||
|
|
||||||
amount = texte[5].replace('\t','').strip().replace(u'€', '').replace(',', '.').replace(u'\xa0', u'')
|
amount = texte[5].replace('\t','').strip().replace(u'€', '').replace(',', '.').replace(u'\xa0', u'')
|
||||||
op.amount = float(amount)
|
op.amount = float(amount)
|
||||||
|
|
||||||
self.operations.append(op)
|
self.transactions.append(op)
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
def get_operations(self):
|
def get_transactions(self):
|
||||||
return self.operations
|
return self.transactions
|
||||||
|
|
||||||
class AccountHistoryLA(BasePage):
|
class AccountHistoryLA(BasePage):
|
||||||
|
|
||||||
def on_loaded(self):
|
def on_loaded(self):
|
||||||
self.operations = []
|
self.transactions = []
|
||||||
i = 1
|
i = 1
|
||||||
history = self.document.xpath('//tr[@align="center"]')
|
history = self.document.xpath('//tr[@align="center"]')
|
||||||
history.pop(0)
|
history.pop(0)
|
||||||
|
|
@ -71,10 +82,10 @@ class AccountHistoryLA(BasePage):
|
||||||
op.amount = float(amount)
|
op.amount = float(amount)
|
||||||
|
|
||||||
|
|
||||||
self.operations.append(op)
|
self.transactions.append(op)
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
|
||||||
def get_operations(self):
|
def get_transactions(self):
|
||||||
return self.operations
|
return self.transactions
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue