Commit ea1da515 authored by Sylvie Ye's avatar Sylvie Ye Committed by Romain Bignon

[cragr] handle internal transfer

parent aa8d4432
......@@ -664,10 +664,16 @@ class CragrAPI(LoginBrowser):
'transferCurrencyCode': account.currency,
'transferDate': transfer.exec_date.strftime('%d/%m/%Y'),
'transferFrequency': 'U',
'transferRef': '',
'transferRef': transfer.label,
'transferType': 'UNIQUE',
'typeCompte': account.label,
}
# update transfer data according to recipient category
if recipient.category == 'Interne':
data['creditAccountNumber'] = recipient.id
data['recipientName'] = recipient._owner_name
# init transfer request
self.transfer.go(
space=space,
......
......@@ -77,6 +77,7 @@ class RecipientsPage(LoggedPage, JsonPage):
obj_category = 'Interne'
obj_enabled_at = date.today()
obj__is_recipient = Dict('recipientOfTransfert', default=False)
obj__owner_name = CleanText(Dict('accountHolderLongDesignation'))
@method
class iter_external_recipient(DictElement):
......@@ -90,7 +91,7 @@ class RecipientsPage(LoggedPage, JsonPage):
klass = Recipient
obj_id = obj_iban = Dict('ibanCode')
obj_label = Dict('recipientName')
obj_label = CleanText(Dict('recipientName'))
obj_category = 'Externe'
obj_enabled_at = date.today()
......@@ -123,8 +124,12 @@ class TransferPage(LoggedPage, JsonPage):
t.account_iban = Dict('currentDebitIbanCode')(self.doc)
t.account_label = Dict('typeCompte')(self.doc)
t.recipient_label = CleanText(Dict('currentCreditAccountName'))(self.doc)
t.recipient_id = t.recipient_iban = Dict('currentCreditIbanCode')(self.doc)
t.recipient_label = Dict('currentCreditAccountName')(self.doc)
# Internal transfer
if not Dict('isExternalTransfer')(self.doc):
t.recipient_id = Dict('currentCreditAccountNumber')(self.doc)
return t
......
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