fix possible conflicts in detection of balance
This commit is contained in:
parent
f4390d9b26
commit
ccb69b2092
1 changed files with 9 additions and 9 deletions
|
|
@ -66,15 +66,15 @@ class AccountsList(BasePage):
|
|||
pass
|
||||
|
||||
elif td.attrib.get('headers', '') == 'Solde':
|
||||
balance = self.parser.tocleanstring(td)
|
||||
if balance is not None and len(balance) > 0 and balance != 'ANNULEE':
|
||||
account.currency = account.get_currency(balance)
|
||||
balance = FrenchTransaction.clean_amount(balance)
|
||||
account.balance = Decimal(balance)
|
||||
else:
|
||||
account.balance = NotAvailable
|
||||
|
||||
print account.label
|
||||
div = td.xpath('./div[@class="Solde"]')
|
||||
if len(div) > 0:
|
||||
balance = self.parser.tocleanstring(div[0])
|
||||
if len(balance) > 0 and balance != 'ANNULEE':
|
||||
account.currency = account.get_currency(balance)
|
||||
balance = FrenchTransaction.clean_amount(balance)
|
||||
account.balance = Decimal(balance)
|
||||
else:
|
||||
account.balance = NotAvailable
|
||||
|
||||
if not account.label or empty(account.balance):
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue