From 2ec22d12f6e4b0b12363eff0c86035cf6d3a800a Mon Sep 17 00:00:00 2001 From: Damien Mat Date: Wed, 17 Jul 2019 16:52:22 +0200 Subject: [PATCH] [hsbc] Take the negative of balance for credits accounts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of doing it only for type loans I did it for any account that appears in a menu named 'Mes crédits' as it was the behaviour before the last website change. Closes: 12373@zendesk --- modules/hsbc/pages/account_pages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/hsbc/pages/account_pages.py b/modules/hsbc/pages/account_pages.py index 53f2238137..b17c8ffc75 100644 --- a/modules/hsbc/pages/account_pages.py +++ b/modules/hsbc/pages/account_pages.py @@ -214,6 +214,8 @@ class item(ItemElement): def obj_balance(self): if Field('type')(self) == Account.TYPE_CARD: return Decimal(0) + elif 'Mes crédits' in CleanText('.//ancestor::div[1]/preceding-sibling::*')(self): + return - abs(Field('_amount')(self)) return Field('_amount')(self) def obj_coming(self): -- GitLab