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

@ -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