diff --git a/modules/oney/backend.py b/modules/oney/backend.py index af0c03ba..3fc1e0d8 100644 --- a/modules/oney/backend.py +++ b/modules/oney/backend.py @@ -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 diff --git a/modules/oney/browser.py b/modules/oney/browser.py index 430269f0..da53f1bc 100644 --- a/modules/oney/browser.py +++ b/modules/oney/browser.py @@ -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()) diff --git a/modules/oney/pages.py b/modules/oney/pages.py index 2dcf1172..62d32512 100644 --- a/modules/oney/pages.py +++ b/modules/oney/pages.py @@ -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