Commit 3760cfdc authored by François Schmidts's avatar François Schmidts Committed by Vincent A

[hsbc] adding diff ratio when available for hsbc/life_insurance module

parent 54d19c58
......@@ -83,6 +83,7 @@ class LifeInsurancesPage(LoggedPage, HTMLPage):
col_portfolio_share = "Répartition"
col_unitvalue = ["Valeur liquidative", re.compile("Valeur de la part")]
col_support_value = re.compile("Valeur support")
col_diff_ratio = "Plus/Moins"
class item(ItemElement):
klass = Investment
......@@ -93,6 +94,12 @@ class LifeInsurancesPage(LoggedPage, HTMLPage):
obj_unitvalue = CleanDecimal(TableCell('unitvalue'), default=Decimal('1'))
obj_valuation = CleanDecimal(TableCell('support_value'))
def obj_diff_ratio(self):
val = self.el.xpath('.//td')[4].text_content().strip().strip('%')
if val == '-':
return NotAvailable
return Decimal(val) / 100
def obj_code(self):
if "Fonds en euros" in Field('label')(self):
return NotAvailable
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