From e465c21b6f938218631e547b040d2aefd99c57d9 Mon Sep 17 00:00:00 2001 From: Damien Mat Date: Tue, 20 Aug 2019 15:23:32 +0200 Subject: [PATCH] [creditmutuel/cic] Fixed accounts listing for revolving credits All "Allure"-type loans are now in the list of revolving credits and rightfully typed as such. Changes had to be made elsewhere in the module since the way revolving credits are managed is cumbersome. They have no parent account to be scraped, this will not make the module fail. Closes: 12930@zendesk, 44917@sibi, 44918@sibi --- modules/creditmutuel/pages.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/creditmutuel/pages.py b/modules/creditmutuel/pages.py index cab80b0cf1..a2bdcdf1ee 100644 --- a/modules/creditmutuel/pages.py +++ b/modules/creditmutuel/pages.py @@ -151,8 +151,9 @@ class item_account_generic(ItemElement): ('Pret', Account.TYPE_LOAN), ('Regroupement De Credits', Account.TYPE_LOAN), ('Nouveau Pret 0%', Account.TYPE_LOAN), + ('Global Auto', Account.TYPE_LOAN), ('Passeport Credit', Account.TYPE_REVOLVING_CREDIT), - ('Allure Libre', Account.TYPE_REVOLVING_CREDIT), + ('Allure', Account.TYPE_REVOLVING_CREDIT), # 'Allure Libre' or 'credit Allure' ('Preference', Account.TYPE_REVOLVING_CREDIT), ('Plan 4', Account.TYPE_REVOLVING_CREDIT), ('P.E.A', Account.TYPE_PEA), @@ -172,7 +173,7 @@ class item_account_generic(ItemElement): REVOLVING_LOAN_LABELS = [ 'Passeport Credit', - 'Allure Libre', + 'Allure', 'Preference', 'Plan 4', 'Credit En Reserve', @@ -429,15 +430,18 @@ class item_revolving_loan(item_account_generic): load_details = Link('.//a') & AsyncLoad obj_total_amount = Async('details') & MyDecimal('//main[@id="ei_tpl_content"]/div/div[2]/table/tbody/tr/td[3]') + obj_type = Account.TYPE_REVOLVING_CREDIT def obj_used_amount(self): return -Field('balance')(self) def condition(self): - _type = Field('type')(self) label = Field('label')(self) - return (item_account_generic.condition(self) and _type == Account.TYPE_LOAN - and self.is_revolving(label)) + return ( + item_account_generic.condition(self) + and Field('type')(self) == Account.TYPE_REVOLVING_CREDIT + and self.is_revolving(label) + ) def get_advisor_link(self): return Link('//div[@id="e_conseiller"]/a', default=None)(self.doc) -- GitLab