support accounts with empty balance
This commit is contained in:
parent
8466b9db8e
commit
8d04e22703
2 changed files with 14 additions and 7 deletions
|
|
@ -112,6 +112,9 @@ class BanquePopulaire(BaseBrowser):
|
||||||
if not self.is_on_page(AccountsPage):
|
if not self.is_on_page(AccountsPage):
|
||||||
account = self.get_account(account.id)
|
account = self.get_account(account.id)
|
||||||
|
|
||||||
|
if account._params is None:
|
||||||
|
return
|
||||||
|
|
||||||
self.location('/cyber/internet/ContinueTask.do', urllib.urlencode(account._params))
|
self.location('/cyber/internet/ContinueTask.do', urllib.urlencode(account._params))
|
||||||
self.token = self.page.get_token()
|
self.token = self.page.get_token()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -246,16 +246,20 @@ class AccountsPage(BasePage):
|
||||||
account.label = u' '.join([u''.join([txt.strip() for txt in tds[1].itertext()]),
|
account.label = u' '.join([u''.join([txt.strip() for txt in tds[1].itertext()]),
|
||||||
u''.join([txt.strip() for txt in tds[2].itertext()])]).strip()
|
u''.join([txt.strip() for txt in tds[2].itertext()])]).strip()
|
||||||
account.type = account_type
|
account.type = account_type
|
||||||
balance = u''.join([txt.strip() for txt in tds[3].itertext()])
|
|
||||||
if balance == u'':
|
balance = FrenchTransaction.clean_amount(u''.join([txt.strip() for txt in tds[3].itertext()]))
|
||||||
balance = '0.0'
|
account.balance = Decimal(balance or '0.0')
|
||||||
account.balance = Decimal(FrenchTransaction.clean_amount(balance))
|
|
||||||
account.currency = account.get_currency(balance)
|
account.currency = account.get_currency(balance)
|
||||||
if account.type == account.TYPE_LOAN:
|
if account.type == account.TYPE_LOAN:
|
||||||
account.balance = - abs(account.balance)
|
account.balance = - abs(account.balance)
|
||||||
account._params = params.copy()
|
|
||||||
account._params['dialogActionPerformed'] = 'SOLDE'
|
if balance == u'':
|
||||||
account._params['attribute($SEL_$%s)' % tr.attrib['id'].split('_')[0]] = tr.attrib['id'].split('_', 1)[1]
|
# There is no detail
|
||||||
|
account._params = None
|
||||||
|
else:
|
||||||
|
account._params = params.copy()
|
||||||
|
account._params['dialogActionPerformed'] = 'SOLDE'
|
||||||
|
account._params['attribute($SEL_$%s)' % tr.attrib['id'].split('_')[0]] = tr.attrib['id'].split('_', 1)[1]
|
||||||
yield account
|
yield account
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue