diff --git a/modules/hsbc/pages/investments.py b/modules/hsbc/pages/investments.py index 9e8a0094e3627a3845bbc294d3d75c5e743c8847..02f6898ee719fd7d03d047e333ed9ca6d07d0af2 100644 --- a/modules/hsbc/pages/investments.py +++ b/modules/hsbc/pages/investments.py @@ -385,10 +385,15 @@ def obj_vdate(self): obj_valuation = CleanDecimal(Dict( 'holdingDetailInformation/0/holdingDetailMultipleCurrencyInformation/0/productHoldingMarketValueAmount' ), default=NotAvailable) - obj_diff_ratio = CleanDecimal(Dict( - 'holdingDetailInformation/0/holdingDetailMultipleCurrencyInformation/0' - '/profitLossUnrealizedPercent' - ), default=NotAvailable) + + def obj_diff_ratio(self): + ratio = CleanDecimal(Dict( + '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 def obj_original_currency(self): @@ -443,9 +448,15 @@ def obj__invest_account_id(self): obj_unitprice = CleanDecimal(Dict( 'holdingSummaryMultipleCurrencyInformation/0/productHoldingUnitCostAverageAmount' ), default=NotAvailable) - obj_diff_ratio = CleanDecimal(Dict( - 'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedPercent' - ), default=NotAvailable) + + def obj_diff_ratio(self): + ratio = CleanDecimal(Dict( + 'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedPercent' + ), default=NotAvailable)(self) + if ratio is not NotAvailable: + ratio /= 100 + return ratio + obj_diff = CleanDecimal(Dict( 'holdingSummaryMultipleCurrencyInformation/0/profitLossUnrealizedAmount' ), default=NotAvailable)