Commit 7f286a11 authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[sgpe] find recipient by id before iban to do transfer

Some sgpe users have recipient with same iban and not same id
Find the recipient by id before
parent 45287629
......@@ -115,9 +115,9 @@ class SocieteGeneraleModule(Module, CapBankWealth, CapBankTransferAddRecipient,
if not account:
account = strict_find_object(self.iter_accounts(), id=transfer.account_id, error=AccountNotFound)
recipient = strict_find_object(self.iter_transfer_recipients(account.id), iban=transfer.recipient_iban)
recipient = strict_find_object(self.iter_transfer_recipients(account.id), id=transfer.recipient_id)
if not recipient:
recipient = strict_find_object(self.iter_transfer_recipients(account.id), id=transfer.recipient_id, error=RecipientNotFound)
recipient = strict_find_object(self.iter_transfer_recipients(account.id), iban=transfer.recipient_iban, error=RecipientNotFound)
transfer.amount = transfer.amount.quantize(Decimal('.01'))
return self.browser.init_transfer(account, recipient, transfer)
......
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