Commit e465c21b authored by Damien Mat's avatar Damien Mat Committed by Vincent A

[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
parent f39ce592
...@@ -151,8 +151,9 @@ class item_account_generic(ItemElement): ...@@ -151,8 +151,9 @@ class item_account_generic(ItemElement):
('Pret', Account.TYPE_LOAN), ('Pret', Account.TYPE_LOAN),
('Regroupement De Credits', Account.TYPE_LOAN), ('Regroupement De Credits', Account.TYPE_LOAN),
('Nouveau Pret 0%', Account.TYPE_LOAN), ('Nouveau Pret 0%', Account.TYPE_LOAN),
('Global Auto', Account.TYPE_LOAN),
('Passeport Credit', Account.TYPE_REVOLVING_CREDIT), ('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), ('Preference', Account.TYPE_REVOLVING_CREDIT),
('Plan 4', Account.TYPE_REVOLVING_CREDIT), ('Plan 4', Account.TYPE_REVOLVING_CREDIT),
('P.E.A', Account.TYPE_PEA), ('P.E.A', Account.TYPE_PEA),
...@@ -172,7 +173,7 @@ class item_account_generic(ItemElement): ...@@ -172,7 +173,7 @@ class item_account_generic(ItemElement):
'Passeport Credit', 'Passeport Credit',
'Allure Libre', 'Allure',
'Preference', 'Preference',
'Plan 4', 'Plan 4',
'Credit En Reserve', 'Credit En Reserve',
...@@ -429,15 +430,18 @@ class AccountsPage(LoggedPage, HTMLPage): ...@@ -429,15 +430,18 @@ class AccountsPage(LoggedPage, HTMLPage):
load_details = Link('.//a') & AsyncLoad 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_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): def obj_used_amount(self):
return -Field('balance')(self) return -Field('balance')(self)
def condition(self): def condition(self):
_type = Field('type')(self)
label = Field('label')(self) label = Field('label')(self)
return (item_account_generic.condition(self) and _type == Account.TYPE_LOAN return (
and self.is_revolving(label)) item_account_generic.condition(self)
and Field('type')(self) == Account.TYPE_REVOLVING_CREDIT
and self.is_revolving(label)
def get_advisor_link(self): def get_advisor_link(self):
return Link('//div[@id="e_conseiller"]/a', default=None)(self.doc) return Link('//div[@id="e_conseiller"]/a', default=None)(self.doc)
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