diff --git a/modules/caissedepargne/pages.py b/modules/caissedepargne/pages.py index 0cfe9407a64de37ff244e4128ec20065b908b08a..a9032b18857123517db18e4786d2d62a69698243 100644 --- a/modules/caissedepargne/pages.py +++ b/modules/caissedepargne/pages.py @@ -296,6 +296,8 @@ def _add_account(self, accounts, link, label, account_type, balance): account.type = self.ACCOUNT_TYPES.get(label, info['acc_type'] if 'acc_type' in info else account_type) if 'PERP' in account.label: account.type = Account.TYPE_PERP + if 'NUANCES CAPITALISATI' in account.label: + account.type = Account.TYPE_CAPITALISATION balance = balance or self.get_balance(account) account.balance = Decimal(FrenchTransaction.clean_amount(balance)) if balance and balance is not NotAvailable else NotAvailable @@ -315,10 +317,10 @@ def _add_account(self, accounts, link, label, account_type, balance): accounts[account.id] = account def get_balance(self, account): - if account.type not in (Account.TYPE_LIFE_INSURANCE, Account.TYPE_PERP): + if account.type not in (Account.TYPE_LIFE_INSURANCE, Account.TYPE_PERP, Account.TYPE_CAPITALISATION): return NotAvailable page = self.go_history(account._info).page - balance = page.doc.xpath('.//tr[td[ends-with(@id,"NumContrat")]/a[contains(text(),$id)]]/td[@class="somme"]', id=account.id) + balance = page.doc.xpath('.//tr[td[contains(@id,"NumContrat")]]/td[@class="somme"]/a[contains(@href, $id)]', id=account.id) if len(balance) > 0: balance = CleanText('.')(balance[0]) balance = balance if balance != u'' else NotAvailable