Commit e89541c9 authored by Maxime Gasselin's avatar Maxime Gasselin Committed by Romain Bignon

[bnporc] Improve history navigation for bnp enterprise

The history were returned for 3 months. Now we return it for 1 year.
Moreover the patch allows to sort and return the transactions page per page.

Closes: 11276@zendesk
parent 363dcb6f
...@@ -125,10 +125,10 @@ class BNPEnterprise(LoginBrowser): ...@@ -125,10 +125,10 @@ class BNPEnterprise(LoginBrowser):
return self._iter_history_base(account) return self._iter_history_base(account)
def _iter_history_base(self, account): def _iter_history_base(self, account):
history = []
dformat = "%Y%m%d" dformat = "%Y%m%d"
for date in rrule(MONTHLY, dtstart=( - relativedelta(months=3)), for date in rrule(MONTHLY, dtstart=( - relativedelta(months=12)),[::-1]:
history = []
self.account_history_view.go( self.account_history_view.go(
identifiant=account.iban, type_solde='C', type_releve='Previsionnel', identifiant=account.iban, type_solde='C', type_releve='Previsionnel',
type_date='O', date_min=(date + relativedelta(days=1)).strftime(dformat), type_date='O', date_min=(date + relativedelta(days=1)).strftime(dformat),
...@@ -146,7 +146,8 @@ class BNPEnterprise(LoginBrowser): ...@@ -146,7 +146,8 @@ class BNPEnterprise(LoginBrowser):
self.logger.debug('skipping coming %r', transaction.to_dict()) self.logger.debug('skipping coming %r', transaction.to_dict())
continue continue
history.append(transaction) history.append(transaction)
return sorted_transactions(history) for transaction in sorted_transactions(history):
yield transaction
@need_login @need_login
def iter_coming_operations(self, account): def iter_coming_operations(self, account):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment