Commit c73cd885 authored by Lucas Ficheux's avatar Lucas Ficheux Committed by Romain Bignon

[bnpcards] Fixed transactions not scrapped for non corporate accounts.

I fixed the methods that filled forms.
Some forms don't use the exact same names for fields even if they convey
the same information.
The field 'numCarteSaisi' doesn't exist anymore so I changed it to
'nomCarteSaisi' or 'titulaireSaisi'.

Closes : 11719@zendesk, 12513@zendesk
parent d9a54cf8
......@@ -138,34 +138,34 @@ class BnpcartesentrepriseBrowser(LoginBrowser):
if account.id not in self.transactions_dict:
self.transactions_dict[account.id] = []
self.ti_histo_go()
self.page.expand(self.page.get_periods()[0], account=account)
self.page.expand(self.page.get_periods()[0], account=account, company=account._company)
for tr in sorted_transactions(self.page.get_history()):
self.transactions_dict[account.id].append(tr)
return self.transactions_dict[account.id]
def get_ti_transactions(self, account):
self.ti_card_go()
self.page.expand(account=account)
self.page.expand(account=account, company=account._company)
for tr in sorted_transactions(self.page.get_history()):
yield tr
self.ti_histo_go()
self.page.expand(self.page.get_periods()[0], account=account)
self.page.expand(self.page.get_periods()[0], account=account, company=account._company)
for period in self.page.get_periods():
self.page.expand(period, account=account)
self.page.expand(period, account=account, company=account._company)
for tr in sorted_transactions(self.page.get_history()):
yield tr
def get_ge_transactions(self, account):
transactions = []
self.coming.go()
self.page.expand(rib=account._rib)
self.page.expand(account=account, rib=account._rib, company=account._company)
link = self.page.get_link(account)
if link:
self.location(link)
transactions += self.page.get_history()
self.history.go()
for period in self.page.get_periods():
self.page.expand(period, rib=account._rib)
self.page.expand(period, rib=account._rib, company=account._company, account=account)
link = self.page.get_link(account)
if link:
self.location(link)
......
......@@ -54,9 +54,13 @@ class ExpandablePage(LoggedPage, HTMLPage):
if rib is not None:
form['ribSaisi'] = rib
if account is not None:
form['numCarteSaisi'] = account._nav_num
form['nomCarteSaisi'] = account.label # some forms use 'nomCarteSaisi' some use 'titulaireSaisie'
form['titulaireSaisie'] = account.label
if company is not None:
form['entrepriseSaisie'] = company
if 'entrepriseSaisie' in form.keys(): # some forms use 'entrepriseSaisie' some use 'entrepriseSaisi'
form['entrepriseSaisie'] = company
else:
form['entrepriseSaisi'] = company
# needed if coporate titulaire
form.url = form.url.replace('Appliquer', 'Afficher')
form.submit()
......@@ -85,12 +89,13 @@ class PeriodsPage(LoggedPage, HTMLPage):
def expand(self, period, account=None, rib=None, company=None):
form = self.get_form(submit='//input[@value="Display"]')
if account is not None:
form['numCarteSaisi'] = account._nav_num
form['nomCarteSaisi'] = account.label
form['titulaireSaisi'] = account.label
form['periodeSaisie'] = period
if rib is not None:
form['ribSaisi'] = rib
if company is not None:
form['entrepriseSaisie'] = company
form['entrepriseSaisi'] = company
# needed if coporate titulaire
form.url = form.url.replace('Appliquer', 'Afficher')
form.submit()
......
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