include current operations in history

This commit is contained in:
Romain Bignon 2014-08-18 18:30:48 +02:00
commit 96a0961905
3 changed files with 13 additions and 2 deletions

View file

@ -53,5 +53,10 @@ class OneyBackend(BaseBackend, CapBank):
return find_object(self.browser.get_accounts_list(), id=_id, error=AccountNotFound)
def iter_history(self, account):
# To prevent issues in calcul of actual balance and coming one, all
# operations are marked as debited.
for tr in self.browser.iter_coming(account):
yield tr
for tr in self.browser.iter_history(account):
yield tr

View file

@ -56,10 +56,16 @@ class OneyBrowser(LoginBrowser):
account.currency = u'EUR'
return [account]
@need_login
def iter_history(self, account):
post = {'task': 'Synthese', 'process': 'SyntheseCompte', 'taskid':'Releve'}
self.operations.go(data=post)
return self.page.iter_transactions(seen=set())
@need_login
def iter_coming(self, account):
post = {'task': 'OperationRecente', 'process': 'OperationRecente', 'taskid':'OperationRecente'}
self.operations.go(data=post)
return self.page.iter_transactions(seen=set())

View file

@ -117,7 +117,7 @@ class IndexPage(LoggedPage, HTMLPage):
return -CleanDecimal('.')(self.doc.xpath('//div[@id = "total-sommes-dues"]/p[contains(text(), "sommes dues")]/span[@class = "montant"]')[0])
class OperationsPage(LoggedPage, HTMLPage):
is_here = "//div[@id='releve-reserve-credit']"
is_here = "//div[@id='releve-reserve-credit'] | //div[@id='operations-recentes']"
@pagination
@method