From f5b1eaa27b1b58dde19c6a24f3229c73733af8b6 Mon Sep 17 00:00:00 2001 From: Quentin Defenouillere Date: Wed, 3 Jun 2020 13:57:19 +0200 Subject: [PATCH] [boursorama] Corrected savingmarketpage quantity & valuation The valuation is obtained by multiplying the quantity with the unitvalue. Since CleanDecimal was used with replace_dots=True whereas the quantity is displayed in the SI format, all valuations were multiplied by 1000. Closes: 19858@zendesk --- modules/boursorama/pages.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/boursorama/pages.py b/modules/boursorama/pages.py index 36ed95f454..df6f93de6a 100644 --- a/modules/boursorama/pages.py +++ b/modules/boursorama/pages.py @@ -48,7 +48,7 @@ from weboob.capabilities.profile import Person from weboob.tools.capabilities.bank.transactions import FrenchTransaction from weboob.tools.capabilities.bank.iban import is_iban_valid -from weboob.tools.capabilities.bank.investments import IsinCode +from weboob.tools.capabilities.bank.investments import IsinCode, IsinType from weboob.tools.value import Value from weboob.tools.date import parse_french_date from weboob.tools.compat import urljoin, urlencode, urlparse, range @@ -891,9 +891,10 @@ class item(ItemElement): klass = Investment obj_label = CleanText(TableCell('label')) - obj_code = CleanText(TableCell('code')) - obj_unitvalue = CleanDecimal(TableCell('unitvalue'), replace_dots=True) - obj_quantity = CleanDecimal(TableCell('quantity'), replace_dots=True) + obj_code = IsinCode(CleanText(TableCell('code'))) + obj_code_type = IsinType(CleanText(TableCell('code'))) + obj_unitvalue = CleanDecimal.French(TableCell('unitvalue')) + obj_quantity = CleanDecimal.SI(TableCell('quantity')) obj_valuation = Eval(lambda x, y: x * y, Field('quantity'), Field('unitvalue')) obj_vdate = Date(CleanText(TableCell('vdate')), dayfirst=True) -- GitLab