fix parsing of amounts

This commit is contained in:
Romain Bignon 2011-09-22 18:05:47 +02:00
commit d67b6449d1
3 changed files with 5 additions and 5 deletions

View file

@ -55,8 +55,8 @@ class AccountHistory(BasePage):
if ' ' in op.label:
op.category, useless, op.label = [part.strip() for part in op.label.partition(' ')]
debit = tr.xpath('.//td[@class="debit"]')[0].text.replace('.','').replace(',','.').strip(u' \t\u20ac\xa0\n')
credit = tr.xpath('.//td[@class="credit"]')[0].text.replace('.','').replace(',','.').strip(u' \t\u20ac\xa0\n')
debit = tr.xpath('.//td[@class="debit"]')[0].text.replace('.','').replace(',','.').strip(u' \t\u20ac\xa0\n\r')
credit = tr.xpath('.//td[@class="credit"]')[0].text.replace('.','').replace(',','.').strip(u' \t\u20ac\xa0\n\r')
if len(debit) > 0:
op.amount = - float(debit)
else: