|
@ -158,18 +158,23 @@ class CamtParser(models.AbstractModel): |
|
|
self.add_value_from_node( |
|
|
self.add_value_from_node( |
|
|
node, './ns:ValDt/ns:Dt', transaction, 'value_date') |
|
|
node, './ns:ValDt/ns:Dt', transaction, 'value_date') |
|
|
transaction.transferred_amount = self.parse_amount(node) |
|
|
transaction.transferred_amount = self.parse_amount(node) |
|
|
self.add_value_from_node( |
|
|
|
|
|
node, './ns:AddtlNtryInf', transaction, 'name') |
|
|
|
|
|
self.add_value_from_node( |
|
|
|
|
|
ns, node, [ |
|
|
|
|
|
'./ns:NtryDtls/ns:RmtInf/ns:Strd/ns:CdtrRefInf/ns:Ref', |
|
|
|
|
|
'./ns:NtryDtls/ns:Btch/ns:PmtInfId', |
|
|
|
|
|
], |
|
|
|
|
|
transaction, 'eref' |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
batch_node = self.xpath(node, './ns:NtryDtls/ns:Btch') |
|
|
|
|
|
if batch_node: |
|
|
|
|
|
self.add_value_from_node( |
|
|
|
|
|
batch_node[0], './ns:PmtInfId', transaction, 'eref') |
|
|
|
|
|
else: |
|
|
|
|
|
self.add_value_from_node( |
|
|
|
|
|
node, './ns:AddtlNtryInf', transaction, 'name') |
|
|
|
|
|
self.add_value_from_node( |
|
|
|
|
|
node, |
|
|
|
|
|
['./ns:NtryDtls/ns:RmtInf/ns:Strd/ns:CdtrRefInf/ns:Ref', |
|
|
|
|
|
'./ns:NtryDtls/ns:Btch/ns:PmtInfId'], |
|
|
|
|
|
transaction, |
|
|
|
|
|
'eref') |
|
|
details_nodes = node.xpath( |
|
|
details_nodes = node.xpath( |
|
|
'./ns:NtryDtls/ns:TxDtls', namespaces={'ns': ns}) |
|
|
'./ns:NtryDtls/ns:TxDtls', namespaces={'ns': ns}) |
|
|
if len(details_nodes) == 0: |
|
|
if len(details_nodes) == 0: |
|
|
|
|
|
transaction.data = etree.tostring(node) |
|
|
yield transaction |
|
|
yield transaction |
|
|
return |
|
|
return |
|
|
transaction_base = transaction |
|
|
transaction_base = transaction |
|
|