Commit ac1cce79 authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[axabanque] get pea history on netfinca bourse page

on axabanque page, pea history leads to an error page (in HTTP ...)
get history on netfinca bourse page for pea liquidity and pea market

Closes: 12819@sibi 12814@sibi 11620@sibi 11492@sibi 13455@sibi 11618@sibi 12821@sibi 11643@sibi
9251@sibi 11496@sibi 12813@sibi 9192@sibi 9203@sibi 9750@sibi 11123@sibi 11495@sibi 12818@sibi
parent f5351136
......@@ -120,9 +120,11 @@ class AXABanque(AXABrowser, StatesMixin):
lifeinsurance_iframe = URL('https://assurance-vie.axabanque.fr/Consultation/SituationContrat.aspx',
'https://assurance-vie.axabanque.fr/Consultation/HistoriqueOperations.aspx', LifeInsuranceIframe)
# netfinca bourse
bourse = URL(r'/transactionnel/client/homepage_bourseCAT.html',
r'https://bourse.axabanque.fr/netfinca-titres/servlet/com.netfinca.*',
BoursePage)
bourse_history = URL(r'https://bourse.axabanque.fr/netfinca-titres/servlet/com.netfinca.frontcr.account.AccountHistory', BoursePage)
# Transfer
recipients = URL('/transactionnel/client/enregistrer-nouveau-beneficiaire.html', RecipientsPage)
......@@ -280,7 +282,21 @@ class AXABanque(AXABrowser, StatesMixin):
def iter_history(self, account):
if account.type == Account.TYPE_LOAN:
return
elif account.type == Account.TYPE_PEA and 'Liquidités' in account.label:
elif account.type == Account.TYPE_PEA:
self.go_account_pages(account, "history")
# go on netfinca page to get pea history
acc = self.get_netfinca_account(account)
self.location(acc._market_link)
self.bourse_history.go()
if not 'Liquidités' in account.label:
self.page.go_history_filter(cash_filter="market")
else:
self.page.go_history_filter(cash_filter="liquidity")
for tr in self.page.iter_history():
yield tr
return
if account.type == Account.TYPE_LIFE_INSURANCE and account._acctype == "bank":
......
......@@ -20,6 +20,7 @@
from collections import OrderedDict
import re
from decimal import Decimal, InvalidOperation
from datetime import datetime, timedelta
from weboob.exceptions import BrowserUnavailable
from weboob.browser.pages import HTMLPage, PDFPage, LoggedPage, AbstractPage
......@@ -554,3 +555,16 @@ class BoursePage(AbstractPage):
# only for netfinca PEA
# can't do it in separate page/on_load because there might be history on this page...
self.get_form(id='formToSubmit').submit()
def go_history_filter(self, cash_filter='all'):
cash_filter_value = {
'market': 0,
'liquidity': 1,
'all': 'ALL',
}
form = self.get_form(id="historyFilter")
form['cashFilter'] = cash_filter_value[cash_filter]
# We can't go above 2 years
form['beginDayfilter'] = (datetime.strptime(form['endDayfilter'], '%d/%m/%Y') - timedelta(days=730)).strftime('%d/%m/%Y')
form.submit()
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