Commit 4a4152af authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[societegenerale] change transfer exec_date for the first available transfer date

Current day for exec_date may be not available anymore to do transfer
because bank agence is closed
Change transfer exec_date for the first available transfer date to avoid bank error
parent bac3b4ca
......@@ -283,6 +283,11 @@ class SocieteGenerale(LoginBrowser, StatesMixin):
@need_login
def init_transfer(self, account, recipient, transfer):
self.json_transfer.go()
first_transfer_date = self.page.get_first_available_transfer_date()
if transfer.exec_date and transfer.exec_date < first_transfer_date:
transfer.exec_date = first_transfer_date
self.page.init_transfer(account, recipient, transfer)
return self.page.handle_response(recipient)
......
......@@ -60,6 +60,9 @@ class TransferJson(LoggedPage, JsonPage):
def is_able_to_transfer(self, account):
return self.get_acc_transfer_id(account)
def get_first_available_transfer_date(self):
return Date(Dict('donnees/listeEmetteursBeneficiaires/premiereDateExecutionPossible'))(self.doc)
@method
class iter_recipients(DictElement):
item_xpath = 'donnees/listeEmetteursBeneficiaires/listeDetailBeneficiaires'
......
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