fixing closed life insurance account on fortuneo

This commit is contained in:
Vincent Paredes 2015-07-06 14:13:51 +02:00 committed by Romain Bignon
commit d8fecab254
2 changed files with 13 additions and 4 deletions

View file

@ -90,9 +90,10 @@ class Fortuneo(Browser):
def get_history(self, account):
self.location(account._link_id)
self.page.select_period()
if self.page.select_period():
return self.page.get_operations(account)
return self.page.get_operations(account)
return ([])
def get_accounts_list(self):
"""accounts list"""

View file

@ -25,6 +25,8 @@ from time import sleep
from datetime import date
from dateutil.relativedelta import relativedelta
from mechanize import FormNotFoundError
from weboob.capabilities.bank import Account, Investment
from weboob.deprecated.browser import Page, BrowserIncorrectPassword
from weboob.capabilities import NotAvailable
@ -91,7 +93,7 @@ class PeaHistoryPage(Page):
return Decimal(value)
def select_period(self):
pass
return True
def get_operations(self, _id):
return iter([])
@ -132,11 +134,15 @@ class InvestmentHistoryPage(Page):
def select_period(self):
self.browser.location(self.url.replace('portefeuille-assurance-vie.jsp', 'operations/assurance-vie-operations.jsp'))
self.browser.select_form(name='OperationsForm')
try:
self.browser.select_form(name='OperationsForm')
except FormNotFoundError:
return False
self.browser.set_all_readonly(False)
self.browser['dateDebut'] = (date.today() - relativedelta(years=1)).strftime('%d/%m/%Y')
self.browser['nbrEltsParPage'] = '100'
self.browser.submit()
return True
def get_operations(self, _id):
for tr in self.document.xpath('//table[@id="tableau_histo_opes"]/tbody/tr'):
@ -160,6 +166,8 @@ class AccountHistoryPage(Page):
self.browser['nbrEltsParPage'] = '100'
self.browser.submit()
return True
def get_operations(self, _id):
"""history, see http://docs.weboob.org/api/capabilities/bank.html?highlight=transaction#weboob.capabilities.bank.Transaction"""