bnpro: support comming transactions

This commit is contained in:
Romain Bignon 2013-07-23 22:10:50 +02:00
commit 105758347d
2 changed files with 18 additions and 5 deletions

View file

@ -59,8 +59,8 @@ class BNPorc(BaseBrowser):
# Pro
'https?://www.secure.bnpparibas.net/banque/portail/entrepros/Fiche\?.*identifiant=PRO_Une_Comptes.*': ProAccountsList,
'https?://www.secure.bnpparibas.net/SAF_ROP\?Origine=DSP_HISTOCPT.*': ProAccountHistory,
'https?://www.secure.bnpparibas.net/SAF_ROP\?Origine=DSP_ET.*': ProAccountHistory,
'https?://www.secure.bnpparibas.net/SAF_ROP.*': ProAccountHistory,
'https?://www.secure.bnpparibas.net/NS_AVEDT.*': ProAccountHistory,
}
def __init__(self, *args, **kwargs):
@ -203,9 +203,9 @@ class BNPorc(BaseBrowser):
if account._stp is not None:
# Pro
self.location(self.buildurl('/SAF_ROP', Origine='DSP_ET', ch4=account._link_id, stp=account._stp))
self.location(self.buildurl('/NS_AVEDT', Origine='DSP_DT', ch4=account._link_id, stp=account._stp))
else:
# Persô
# Perso
if not self.is_on_page(AccountsList):
self.location('/NSFR?Action=DSP_VGLOBALE')

View file

@ -106,4 +106,17 @@ class ProAccountHistory(BasePage):
yield op
def iter_coming_operations(self):
raise NotImplementedError()
for i, tr in enumerate(self.document.xpath('//tr[@class="hdoc1" or @class="hdotc1"]')):
cols = tr.findall('td')
op = Transaction(i)
date = self.parser.tocleanstring(cols[self.COL_DATE])
raw = self.parser.tocleanstring(cols[self.COL_LABEL])
raw = re.sub(r'[ \xa0]+', ' ', raw).strip()
op.parse(date=date, raw=raw)
credit = self.parser.tocleanstring(cols[self.COL_CREDIT])
op.set_amount(credit)
yield op