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):
return self._iter_history_base(account)
def _iter_history_base(self, account):
history = []
dformat = "%Y%m%d"
for date in rrule(MONTHLY, dtstart=(datetime.now() - relativedelta(months=3)), until=datetime.now()):
for date in rrule(MONTHLY, dtstart=(datetime.now() - relativedelta(months=12)), until=datetime.now())[::-1]:
history = []
self.account_history_view.go(
identifiant=account.iban, type_solde='C', type_releve='Previsionnel',
type_date='O', date_min=(date + relativedelta(days=1)).strftime(dformat),
......@@ -146,7 +146,8 @@ class BNPEnterprise(LoginBrowser):
self.logger.debug('skipping coming %r', transaction.to_dict())
continue
history.append(transaction)
return sorted_transactions(history)
for transaction in sorted_transactions(history):
yield transaction
@need_login
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