carrefourbanque fix when account balance is negative

This commit is contained in:
Baptiste Delpey 2015-07-15 15:08:49 +02:00 committed by Romain Bignon
commit d4ebe70d5d

View file

@ -55,7 +55,7 @@ class HomePage(LoggedPage, HTMLPage):
def obj_balance(self):
if len(self.el.xpath('.//div[@class="catre_col_one"]/h2')) > 0:
return CleanDecimal(Format('-%s', CleanText('.//div[@class="catre_col_one"]/h2')), replace_dots=True)(self)
return -CleanDecimal(CleanText('.//div[@class="catre_col_one"]/h2'), replace_dots=True)(self)
else:
return Decimal('0')