Commit 6861cd24 authored by Quentin Defenouillere's avatar Quentin Defenouillere Committed by Romain Bignon

[creditdunord] Corrected bugs for account.balance and LI investments

parent 95322730
......@@ -165,11 +165,12 @@ class CreditDuNordBrowser(LoginBrowser):
self.location(account._link, data=account._args)
if self.page.can_iter_investments() and self.page.not_restrained():
return self.page.get_market_investment()
elif account.type in (Account.TYPE_LIFE_INSURANCE, Account.TYPE_CAPITALISATION):
self.location(account._link, data=account._args)
self.location(account._link.replace("_attente", "_detail_contrat_rep"), data=account._args)
if self.page.can_iter_investments():
return self.page.get_deposit_investment()
return self.page.get_li_investments()
return []
@need_login
......
......@@ -687,9 +687,9 @@ class TransactionsPage(LoggedPage, CDNBasePage):
return "Sous-total" not in Field('label')(self)
@method
class get_deposit_investment(TableElement):
class get_li_investments(TableElement):
item_xpath = '//table[@class="datas"]//tr[position()>1]'
head_xpath = '//table[@class="datas"]//tr[@class="entete"]/td/b'
head_xpath = '//table[@class="datas"]//tr[@class="entete"]/td/*'
col_label = u'Libellé'
col_quantity = u'Quantité'
......@@ -726,7 +726,7 @@ class TransactionsPage(LoggedPage, CDNBasePage):
def fill_diff_currency(self, account):
valuation_diff = CleanText(u'//td[span[contains(text(), "dont +/- value : ")]]//b', default=None)(self.doc)
account.balance = CleanDecimal.French(Regexp(CleanText('//table[@class="v1-formbloc"]//td[@class="v1-labels"]/b[contains(text(), "Estimation du contrat")]/ancestor::td/following-sibling::td[1]'), r'^(.+) EUR'))(self.doc)
account.balance = CleanDecimal.French(Regexp(CleanText('//table[@class="v1-formbloc"]//td[@class="v1-labels"]//b[contains(text(), "Estimation du contrat")]/ancestor::td/following-sibling::td[1]'), r'^(.+) EUR'))(self.doc)
# NC == Non communiqué
if valuation_diff and "NC" not in valuation_diff:
account.valuation_diff = MyDecimal().filter(valuation_diff)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment