diff --git a/modules/boursorama/browser.py b/modules/boursorama/browser.py index 6b27d782b4e7d6ed0d852574c10d41afe97cd840..1ccef1d7c7cc85710ecc1ab8f01e71f9a2d2e5b2 100644 --- a/modules/boursorama/browser.py +++ b/modules/boursorama/browser.py @@ -356,6 +356,7 @@ def get_card_transactions(self, account, coming): if self.deferred_card_calendar is None: self.location(self.page.get_calendar_link()) + params = {} params['movementSearch[fromDate]'] = (date.today() - relativedelta(years=3)).strftime('%d/%m/%Y') params['fullSearch'] = 1 diff --git a/modules/boursorama/pages.py b/modules/boursorama/pages.py index 0aa47f1093ac5444ab765a999fe368e7be05b0e2..a34047d6a14011fa9ba4d22264ac42657fcd5823 100644 --- a/modules/boursorama/pages.py +++ b/modules/boursorama/pages.py @@ -266,7 +266,6 @@ def condition(self): return not self.is_external() and not any(x in Field('url')(self) for x in ('automobile', 'assurance/protection', 'assurance/comptes', 'assurance/famille')) obj_label = CleanText('.//a[has-class("account--name")] | .//div[has-class("account--name")]') - obj_currency = FrenchTransaction.Currency('.//a[has-class("account--balance")]') obj_valuation_diff = Async('details') & CleanDecimal('//li[h4[text()="Total des +/- values"]]/h3 |\ //li[span[text()="Total des +/- values latentes"]]/span[has-class("overview__value")]', replace_dots=True, default=NotAvailable) @@ -306,6 +305,8 @@ def obj_id(self): raise SkipItem() return id + obj_number = obj_id + def obj_type(self): # card url is /compte/cav/xxx/carte/yyy so reverse to match "carte" before "cav" for word in Field('url')(self).lower().split('/')[::-1]: @@ -567,16 +568,19 @@ class item(ItemElement): klass = Transaction obj_raw = Transaction.Raw(Dict('label')) - obj_date = Date(Dict('dateVal'), dayfirst=True) - obj_bdate = Date(Dict('dateOp'), dayfirst=True) + obj_bdate = Date(Dict('dateOp')) + + def obj_date(self): + return self.page.browser.get_debit_date(Field('bdate')(self)) + obj__account_label = Dict('accountLabel') obj__is_coming = False def obj_amount(self): if Field('type')(self) == Transaction.TYPE_CARD_SUMMARY: # '-' so the reimbursements appear positively in the card transactions: - return -CleanDecimal(Dict('amount'), replace_dots=True)(self) - return CleanDecimal(Dict('amount'), replace_dots=True)(self) + return -CleanDecimal.US(Dict('amount'))(self) + return CleanDecimal.US(Dict('amount'))(self) def obj_rdate(self): if self.obj.rdate: