introduce new type Account.TYPE_LIKE_INSURANCE
This commit is contained in:
parent
55f8bbcf2e
commit
2f61835521
6 changed files with 8 additions and 6 deletions
|
|
@ -144,7 +144,7 @@ class Boursorama(Browser):
|
||||||
link = self.page.get_next_url()
|
link = self.page.get_next_url()
|
||||||
|
|
||||||
def get_investment(self, account):
|
def get_investment(self, account):
|
||||||
if account.type != Account.TYPE_MARKET or not account._detail_url:
|
if account.type != Account.TYPE_LIFE_INSURANCE or not account._detail_url:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
self.location(account._detail_url)
|
self.location(account._detail_url)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class AccountsList(Page):
|
||||||
account._link_id = None
|
account._link_id = None
|
||||||
if 'assurance vie' in block_title:
|
if 'assurance vie' in block_title:
|
||||||
# Life insurance accounts are investments
|
# Life insurance accounts are investments
|
||||||
account.type = Account.TYPE_MARKET
|
account.type = Account.TYPE_LIFE_INSURANCE
|
||||||
for td in tr.getiterator('td'):
|
for td in tr.getiterator('td'):
|
||||||
if td.get('class', '') == 'account-cb':
|
if td.get('class', '') == 'account-cb':
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ class AccountsList(Page):
|
||||||
return len(form) > 0
|
return len(form) > 0
|
||||||
|
|
||||||
ACCOUNT_TYPES = {'mes-comptes/compte-courant': Account.TYPE_CHECKING,
|
ACCOUNT_TYPES = {'mes-comptes/compte-courant': Account.TYPE_CHECKING,
|
||||||
'mes-comptes/assurance-vie': Account.TYPE_MARKET,
|
'mes-comptes/assurance-vie': Account.TYPE_LIFE_INSURANCE,
|
||||||
'mes-comptes/livret': Account.TYPE_LOAN,
|
'mes-comptes/livret': Account.TYPE_LOAN,
|
||||||
}
|
}
|
||||||
def get_list(self):
|
def get_list(self):
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ class IngBrowser(LoginBrowser):
|
||||||
@need_login
|
@need_login
|
||||||
@check_bourse
|
@check_bourse
|
||||||
def get_history(self, account):
|
def get_history(self, account):
|
||||||
if account.type == Account.TYPE_MARKET:
|
if account.type in (Account.TYPE_MARKET, Account.TYPE_LIFE_INSURANCE):
|
||||||
for result in self.get_history_titre(account):
|
for result in self.get_history_titre(account):
|
||||||
yield result
|
yield result
|
||||||
return
|
return
|
||||||
|
|
@ -258,7 +258,7 @@ class IngBrowser(LoginBrowser):
|
||||||
@need_login
|
@need_login
|
||||||
@check_bourse
|
@check_bourse
|
||||||
def get_investments(self, account):
|
def get_investments(self, account):
|
||||||
if account.type != Account.TYPE_MARKET:
|
if account.type not in (Account.TYPE_MARKET, Account.TYPE_LIFE_INSURANCE):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
self.go_investments(account)
|
self.go_investments(account)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ class AddType(Filter):
|
||||||
types = {u'Courant': Account.TYPE_CHECKING, u'Livret A': Account.TYPE_SAVINGS,
|
types = {u'Courant': Account.TYPE_CHECKING, u'Livret A': Account.TYPE_SAVINGS,
|
||||||
u'Orange': Account.TYPE_SAVINGS, u'Durable': Account.TYPE_SAVINGS,
|
u'Orange': Account.TYPE_SAVINGS, u'Durable': Account.TYPE_SAVINGS,
|
||||||
u'Titres': Account.TYPE_MARKET, u'PEA': Account.TYPE_MARKET,
|
u'Titres': Account.TYPE_MARKET, u'PEA': Account.TYPE_MARKET,
|
||||||
u'Direct Vie': Account.TYPE_MARKET}
|
u'Direct Vie': Account.TYPE_LIFE_INSURANCE}
|
||||||
|
|
||||||
def filter(self, label):
|
def filter(self, label):
|
||||||
for key, acc_type in self.types.items():
|
for key, acc_type in self.types.items():
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,8 @@ class Account(Recipient):
|
||||||
"Joint account"
|
"Joint account"
|
||||||
TYPE_CARD = 7
|
TYPE_CARD = 7
|
||||||
"Card account"
|
"Card account"
|
||||||
|
TYPE_LIFE_INSURANCE = 8
|
||||||
|
"Life insurances"
|
||||||
|
|
||||||
type = IntField('Type of account', default=TYPE_UNKNOWN)
|
type = IntField('Type of account', default=TYPE_UNKNOWN)
|
||||||
balance = DecimalField('Balance on this bank account')
|
balance = DecimalField('Balance on this bank account')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue