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

[hsbc] correcting diff ratio for investments

parent 334f0096
...@@ -385,10 +385,15 @@ class RetrieveInvestmentsPage(LoggedPage, JsonPage): ...@@ -385,10 +385,15 @@ class RetrieveInvestmentsPage(LoggedPage, JsonPage):
obj_valuation = CleanDecimal(Dict( obj_valuation = CleanDecimal(Dict(
'holdingDetailInformation/0/holdingDetailMultipleCurrencyInformation/0/productHoldingMarketValueAmount' 'holdingDetailInformation/0/holdingDetailMultipleCurrencyInformation/0/productHoldingMarketValueAmount'
), default=NotAvailable) ), default=NotAvailable)
obj_diff_ratio = CleanDecimal(Dict(
'holdingDetailInformation/0/holdingDetailMultipleCurrencyInformation/0' def obj_diff_ratio(self):
'/profitLossUnrealizedPercent' ratio = CleanDecimal(Dict(
), default=NotAvailable) 'holdingDetailInformation/0/holdingDetailMultipleCurrencyInformation/0/profitLossUnrealizedPercent'
), default=NotAvailable)(self)
if ratio is not NotAvailable:
ratio /= 100
return ratio
obj_portfolio_share = NotAvailable # must be computed from the sum of iter_investments obj_portfolio_share = NotAvailable # must be computed from the sum of iter_investments
def obj_original_currency(self): def obj_original_currency(self):
...@@ -443,9 +448,15 @@ class RetrieveInvestmentsPage(LoggedPage, JsonPage): ...@@ -443,9 +448,15 @@ class RetrieveInvestmentsPage(LoggedPage, JsonPage):
obj_unitprice = CleanDecimal(Dict( obj_unitprice = CleanDecimal(Dict(
'holdingSummaryMultipleCurrencyInformation/0/productHoldingUnitCostAverageAmount' 'holdingSummaryMultipleCurrencyInformation/0/productHoldingUnitCostAverageAmount'
), default=NotAvailable) ), default=NotAvailable)
obj_diff_ratio = CleanDecimal(Dict(
'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedPercent' def obj_diff_ratio(self):
), default=NotAvailable) ratio = CleanDecimal(Dict(
'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedPercent'
), default=NotAvailable)(self)
if ratio is not NotAvailable:
ratio /= 100
return ratio
obj_diff = CleanDecimal(Dict( obj_diff = CleanDecimal(Dict(
'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedAmount' 'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedAmount'
), default=NotAvailable) ), default=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