first commit
This commit is contained in:
76
modules/account_payment_sepa/template/base.003.xml
Normal file
76
modules/account_payment_sepa/template/base.003.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<py:strip xmlns:py="http://genshi.edgewall.org/">
|
||||
<!-- only ASCII -->
|
||||
<py:def function="PartyIdentification(party, id=None, with_name=True, with_address=True)">
|
||||
<!-- EPC limits to 70 instead of 140 -->
|
||||
<Nm py:if="with_name">${normalize('NFKD', party.name).encode('ascii', 'replace')[:70]}</Nm>
|
||||
<py:if test="with_address">
|
||||
<py:with vars="address = party.address_get()">
|
||||
<PstlAdr py:if="address">
|
||||
${PostalAddress(address)}
|
||||
</PstlAdr>
|
||||
</py:with>
|
||||
</py:if>
|
||||
<Id py:if="id">
|
||||
<py:with vars="identifier = party.get_sepa_identifier(id)">
|
||||
<OrgId py:if="identifier['Type'] == 'OrgId'">
|
||||
<BICOrBEI py:if="identifier.get('BICOrBEI')">${identifier['BICOrBEI']}</BICOrBEI>
|
||||
<Othr py:if="identifier.get('Id')">
|
||||
<Id>${identifier['Id']}</Id>
|
||||
<SchmeNm py:if="identifier.get('SchmeNm')">
|
||||
<Cd py:if="identifier['SchmeNm'].get('Cd')">${identifier['SchmeNm']['Cd']}</Cd>
|
||||
<Prtry py:if="identifier['SchmeNm'].get('Prtry')">${identifier['SchmeNm']['Cd']}</Prtry>
|
||||
</SchmeNm>
|
||||
<Issr py:if="identifier.get('Issr')">${identifier['Issr']}</Issr>
|
||||
</Othr>
|
||||
</OrgId>
|
||||
<PrvtId py:if="identifier['Type'] == 'PrvtId'">
|
||||
<DtAndPlcOfBirth py:if="identifier.get('DtAndPlcOfBirth')">
|
||||
<BirthDt>${identifier['DtAndPlcOfBirth']['BirthDt'].isoformat()}</BirthDt>
|
||||
<PrvcOfBirth py:if="identifier['DtAndPlcOfBirth'].get('PrvcOfBirth')">${identifier['DtAndPlcOfBirth']['PrvcOfBirth']}</PrvcOfBirth>
|
||||
<CityOfBirth>${identifier['DtAndPlcOfBirth']['CityOfBirth']}</CityOfBirth>
|
||||
<CtryOfBirth>${identifier['DtAndPlcOfBirth']['CtryOfBirth']}</CtryOfBirth>
|
||||
</DtAndPlcOfBirth>
|
||||
<Othr py:if="identifier.get('Id')">
|
||||
<Id>${identifier['Id']}</Id>
|
||||
<SchmeNm py:if="identifier.get('SchmeNm')">
|
||||
<Cd py:if="identifier['SchmeNm'].get('Cd')">${identifier['SchmeNm']['Cd']}</Cd>
|
||||
<Prtry py:if="identifier['SchmeNm'].get('Prtry')">${identifier['SchmeNm']['Prtry']}</Prtry>
|
||||
</SchmeNm>
|
||||
<Issr py:if="identifier.get('Issr')">${identifier['Issr']}</Issr>
|
||||
</Othr>
|
||||
</PrvtId>
|
||||
</py:with>
|
||||
</Id>
|
||||
<!-- CtryOfRes -->
|
||||
<!-- CtctDtls -->
|
||||
</py:def>
|
||||
<py:def function="PostalAddress(address)">
|
||||
<Ctry py:if="address.country">${normalize('NFKD', address.country.code).encode('ascii', 'replace')}</Ctry>
|
||||
<py:if test="address.street">
|
||||
<py:for each="line in address.street.splitlines()[1:8]">
|
||||
<AdrLine py:if="address.street">${normalize('NFKD', line).encode('ascii', 'replace')[:70]}</AdrLine>
|
||||
</py:for>
|
||||
</py:if>
|
||||
</py:def>
|
||||
<py:def function="Account(account_number, with_ccy=True)">
|
||||
<Id>
|
||||
<!-- EPC only IBAN is allowed -->
|
||||
<IBAN>${account_number.compact_iban}</IBAN>
|
||||
</Id>
|
||||
<!-- Tp -->
|
||||
<Ccy py:if="with_ccy and account_number.account.currency">${account_number.account.currency.code}</Ccy>
|
||||
<!-- Nm -->
|
||||
</py:def>
|
||||
<!-- uses BIC instead of BICFI -->
|
||||
<py:def function="FinancialInstitution(bank, only_bic=False)">
|
||||
<FinInstnId>
|
||||
<BIC py:if="bank.bic">${bank.bic}</BIC>
|
||||
<Othr py:if="not bank.bic">
|
||||
<Id>NOTPROVIDED</Id>
|
||||
</Othr>
|
||||
</FinInstnId>
|
||||
</py:def>
|
||||
</py:strip>
|
||||
90
modules/account_payment_sepa/template/base.xml
Normal file
90
modules/account_payment_sepa/template/base.xml
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<py:strip xmlns:py="http://genshi.edgewall.org/">
|
||||
<py:def function="PartyIdentification(party, id=None)">
|
||||
<!-- EPC limits to 70 instead of 140 -->
|
||||
<Nm>${party.name[:70]}</Nm>
|
||||
<py:with vars="address = party.address_get()">
|
||||
<PstlAdr py:if="address">
|
||||
${PostalAddress(address)}
|
||||
</PstlAdr>
|
||||
</py:with>
|
||||
<Id py:if="id">
|
||||
<py:with vars="identifier = party.get_sepa_identifier(id)">
|
||||
<OrgId py:if="identifier['Type'] == 'OrgId'">
|
||||
<BICOrBEI py:if="identifier.get('BICOrBEI')">${identifier['BICOrBEI']}</BICOrBEI>
|
||||
<Othr py:if="identifier.get('Id')">
|
||||
<Id>${identifier['Id']}</Id>
|
||||
<SchmeNm py:if="identifier.get('SchmeNm')">
|
||||
<Cd py:if="identifier['SchmeNm'].get('Cd')">${identifier['SchmeNm']['Cd']}</Cd>
|
||||
<Prtry py:if="identifier['SchmeNm'].get('Prtry')">${identifier['SchmeNm']['Cd']}</Prtry>
|
||||
</SchmeNm>
|
||||
<Issr py:if="identifier.get('Issr')">${identifier['Issr']}</Issr>
|
||||
</Othr>
|
||||
</OrgId>
|
||||
<PrvtId py:if="identifier['Type'] == 'PrvtId'">
|
||||
<DtAndPlcOfBirth py:if="identifier.get('DtAndPlcOfBirth')">
|
||||
<BirthDt>${identifier['DtAndPlcOfBirth']['BirthDt'].isoformat()}</BirthDt>
|
||||
<PrvcOfBirth py:if="identifier['DtAndPlcOfBirth'].get('PrvcOfBirth')">${identifier['DtAndPlcOfBirth']['PrvcOfBirth']}</PrvcOfBirth>
|
||||
<CityOfBirth>${identifier['DtAndPlcOfBirth']['CityOfBirth']}</CityOfBirth>
|
||||
<CtryOfBirth>${identifier['DtAndPlcOfBirth']['CtryOfBirth']}</CtryOfBirth>
|
||||
</DtAndPlcOfBirth>
|
||||
<Othr py:if="identifier.get('Id')">
|
||||
<Id>${identifier['Id']}</Id>
|
||||
<SchmeNm py:if="identifier.get('SchmeNm')">
|
||||
<Cd py:if="identifier['SchmeNm'].get('Cd')">${identifier['SchmeNm']['Cd']}</Cd>
|
||||
<Prtry py:if="identifier['SchmeNm'].get('Prtry')">${identifier['SchmeNm']['Prtry']}</Prtry>
|
||||
</SchmeNm>
|
||||
<Issr py:if="identifier.get('Issr')">${identifier['Issr']}</Issr>
|
||||
</Othr>
|
||||
</PrvtId>
|
||||
</py:with>
|
||||
</Id>
|
||||
<!-- CtryOfRes -->
|
||||
<!-- CtctDtls -->
|
||||
</py:def>
|
||||
<py:def function="PostalAddress(address)">
|
||||
<!-- AdrTp -->
|
||||
<!-- Dept -->
|
||||
<!-- SubDept -->
|
||||
<StrtNm py:if="address.street_name">${address.street_name[:70]}</StrtNm>
|
||||
<BldgNb py:if="address.building_number">${address.building_number[:16]}</BldgNb>
|
||||
<PstCd py:if="address.postal_code">${address.postal_code[:16]}</PstCd>
|
||||
<TwnNm py:if="address.city">${address.city[:35]}</TwnNm>
|
||||
<CtrySubDvsn py:if="address.subdivision">${address.subdivision.rec_name[:35]}</CtrySubDvsn>
|
||||
<Ctry py:if="address.country">${address.country.code}</Ctry>
|
||||
<py:if test="address.street_unstructured">
|
||||
<py:for each="line in address.street_unstructured.splitlines()[1:8]">
|
||||
<AdrLine py:if="line">${line[:70]}</AdrLine>
|
||||
</py:for>
|
||||
</py:if>
|
||||
</py:def>
|
||||
<py:def function="Account(account_number, currency=True)">
|
||||
<Id>
|
||||
<!-- EPC only IBAN is allowed -->
|
||||
<IBAN>${account_number.compact_iban}</IBAN>
|
||||
</Id>
|
||||
<!-- Tp -->
|
||||
<Ccy py:if="currency and account_number.account.currency">${account_number.account.currency.code}</Ccy>
|
||||
<!-- Nm -->
|
||||
</py:def>
|
||||
<py:def function="FinancialInstitution(bank, only_bic=False)">
|
||||
<FinInstnId>
|
||||
<BICFI py:if="bank.bic">${bank.bic}</BICFI>
|
||||
<py:if test="not only_bic">
|
||||
<!-- ClrSysMmbId -->
|
||||
<Nm>${bank.party.name[:140]}</Nm>
|
||||
<py:with vars="address = bank.party.address_get()">
|
||||
<PstlAdr py:if="address">
|
||||
${PostalAddress(address)}
|
||||
</PstlAdr>
|
||||
</py:with>
|
||||
</py:if>
|
||||
<Othr py:if="not bank.bic">
|
||||
<Id>NOTPROVIDED</Id>
|
||||
</Othr>
|
||||
</FinInstnId>
|
||||
<!-- BrnchId -->
|
||||
</py:def>
|
||||
</py:strip>
|
||||
116
modules/account_payment_sepa/template/pain.001.001.03.xml
Normal file
116
modules/account_payment_sepa/template/pain.001.001.03.xml
Normal file
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:py="http://genshi.edgewall.org/">
|
||||
<xi:include href="base.xml"/>
|
||||
<!-- version 3 uses BIC instead of BICFI -->
|
||||
<py:def function="FinancialInstitution(bank, only_bic=False)">
|
||||
<FinInstnId>
|
||||
<BIC py:if="bank.bic">${bank.bic}</BIC>
|
||||
<py:if test="not only_bic">
|
||||
<!-- ClrSysMmbId -->
|
||||
<Nm>${bank.party.name[:140]}</Nm>
|
||||
<py:with vars="address = bank.party.address_get()">
|
||||
<PstlAdr py:if="address">
|
||||
${PostalAddress(address)}
|
||||
</PstlAdr>
|
||||
</py:with>
|
||||
</py:if>
|
||||
<Othr py:if="not bank.bic">
|
||||
<Id>NOTPROVIDED</Id>
|
||||
</Othr>
|
||||
</FinInstnId>
|
||||
<!-- BrnchId -->
|
||||
</py:def>
|
||||
<CstmrCdtTrfInitn>
|
||||
<GrpHdr>
|
||||
<MsgId>${group.sepa_message_id[:35]}</MsgId>
|
||||
<CreDtTm>${datetime.datetime.now().replace(microsecond=0).isoformat()}</CreDtTm>
|
||||
<!-- Authstn -->
|
||||
<NbOfTxs>${sum(len(payments) for _, payments in group.sepa_payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in group.payments)}</CtrlSum>
|
||||
<!-- PmtTpInf -->
|
||||
<!-- ReqdColltnDt -->
|
||||
<InitgPty>
|
||||
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_payable_initiator_id)}
|
||||
</InitgPty>
|
||||
<!-- FwdgAgt -->
|
||||
</GrpHdr>
|
||||
<PmtInf py:for="key, payments in group.sepa_payments">
|
||||
<PmtInfId>${key['payment_info'][:35]}</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<BtchBookg>${'true' if group.journal.sepa_batch_booking else 'false'}</BtchBookg>
|
||||
<NbOfTxs>${len(payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in payments)}</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<!-- InstrPrty -->
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
<!-- LclInstrm -->
|
||||
<!-- CtgyPurp -->
|
||||
</PmtTpInf>
|
||||
<ReqdExctnDt>${key['date'].isoformat()}</ReqdExctnDt>
|
||||
<!-- PoolgAdjstmntDt -->
|
||||
<Dbtr>
|
||||
${PartyIdentification(group.company.party)}
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
${Account(group.journal.sepa_bank_account_number)}
|
||||
</DbtrAcct>
|
||||
<DbtrAgt>
|
||||
${FinancialInstitution(group.journal.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</DbtrAgt>
|
||||
<!-- DbtrAgtAcct -->
|
||||
<!-- UltmtDbtr -->
|
||||
<ChrgBr>${group.journal.sepa_charge_bearer}</ChrgBr>
|
||||
<!-- ChrgsAcct -->
|
||||
<!-- ChrgsAcctAgt -->
|
||||
<CdtTrfTxInf py:for="payment in payments">
|
||||
<PmtId>
|
||||
<InstrId>${payment.sepa_instruction_id}</InstrId>
|
||||
<EndToEndId>${payment.sepa_end_to_end_id}</EndToEndId>
|
||||
</PmtId>
|
||||
<!-- PmtTpInf --> <!-- EPC only at payment information level -->
|
||||
<Amt>
|
||||
<InstdAmt py:attrs="{'Ccy': payment.currency.code}">${payment.amount}</InstdAmt>
|
||||
<!-- EqvtAmt -->
|
||||
</Amt>
|
||||
<!-- XchgRateInf -->
|
||||
<!-- ChrgBr --> <!-- EPC only at payment information level -->
|
||||
<!-- ChqInstr -->
|
||||
<!-- UltmtDbtr -->
|
||||
<!-- IntrmyAgt1 -->
|
||||
<!-- IntrmyAgt1Acct -->
|
||||
<!-- IntrmyAgt2 -->
|
||||
<!-- IntrmyAgt2Acct -->
|
||||
<!-- IntrmyAgt3 -->
|
||||
<!-- IntrmyAgt3Acct -->
|
||||
<CdtrAgt>
|
||||
${FinancialInstitution(payment.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</CdtrAgt>
|
||||
<!-- CdtrAgtAcct -->
|
||||
<Cdtr>
|
||||
${PartyIdentification(payment.party)}
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
${Account(payment.sepa_bank_account_number)}
|
||||
</CdtrAcct>
|
||||
<!-- UltmtCdtr -->
|
||||
<!-- InstrForCdtrAgt -->
|
||||
<!-- InstrForDbtrAgt -->
|
||||
<!-- Purp -->
|
||||
<!-- RgltryRptg -->
|
||||
<!-- Tax -->
|
||||
<!-- RltdRmtInf -->
|
||||
<RmtInf py:if="payment.sepa_remittance_information">
|
||||
<Ustrd>${payment.sepa_remittance_information[:140]}</Ustrd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
</PmtInf>
|
||||
</CstmrCdtTrfInitn>
|
||||
</Document>
|
||||
100
modules/account_payment_sepa/template/pain.001.001.05.xml
Normal file
100
modules/account_payment_sepa/template/pain.001.001.05.xml
Normal file
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.05"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:py="http://genshi.edgewall.org/">
|
||||
<xi:include href="base.xml"/>
|
||||
<CstmrCdtTrfInitn>
|
||||
<GrpHdr>
|
||||
<MsgId>${group.sepa_message_id[:35]}</MsgId>
|
||||
<CreDtTm>${datetime.datetime.now().replace(microsecond=0).isoformat()}</CreDtTm>
|
||||
<!-- Authstn -->
|
||||
<NbOfTxs>${sum(len(payments) for _, payments in group.sepa_payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in group.payments)}</CtrlSum>
|
||||
<!-- PmtTpInf -->
|
||||
<!-- ReqdColltnDt -->
|
||||
<InitgPty>
|
||||
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_payable_initiator_id)}
|
||||
</InitgPty>
|
||||
<!-- FwdgAgt -->
|
||||
</GrpHdr>
|
||||
<PmtInf py:for="key, payments in group.sepa_payments">
|
||||
<PmtInfId>${key['payment_info'][:35]}</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<BtchBookg>${'true' if group.journal.sepa_batch_booking else 'false'}</BtchBookg>
|
||||
<NbOfTxs>${len(payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in payments)}</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<!-- InstrPrty -->
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
<!-- LclInstrm -->
|
||||
<!-- CtgyPurp -->
|
||||
</PmtTpInf>
|
||||
<ReqdExctnDt>${key['date'].isoformat()}</ReqdExctnDt>
|
||||
<!-- PoolgAdjstmntDt -->
|
||||
<Dbtr>
|
||||
${PartyIdentification(group.company.party)}
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
${Account(group.journal.sepa_bank_account_number)}
|
||||
</DbtrAcct>
|
||||
<DbtrAgt>
|
||||
${FinancialInstitution(group.journal.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</DbtrAgt>
|
||||
<!-- DbtrAgtAcct -->
|
||||
<!-- InstrForDbtrAgt -->
|
||||
<!-- UltmtDbtr -->
|
||||
<ChrgBr>${group.journal.sepa_charge_bearer}</ChrgBr>
|
||||
<!-- ChrgsAcct -->
|
||||
<!-- ChrgsAcctAgt -->
|
||||
<CdtTrfTxInf py:for="payment in payments">
|
||||
<PmtId>
|
||||
<InstrId>${payment.sepa_instruction_id}</InstrId>
|
||||
<EndToEndId>${payment.sepa_end_to_end_id}</EndToEndId>
|
||||
</PmtId>
|
||||
<!-- PmtTpInf --> <!-- EPC only at payment information level -->
|
||||
<Amt>
|
||||
<InstdAmt py:attrs="{'Ccy': payment.currency.code}">${payment.amount}</InstdAmt>
|
||||
<!-- EqvtAmt -->
|
||||
</Amt>
|
||||
<!-- XchgRateInf -->
|
||||
<!-- ChrgBr --> <!-- EPC only at payment information level -->
|
||||
<!-- ChqInstr -->
|
||||
<!-- UltmtDbtr -->
|
||||
<!-- IntrmyAgt1 -->
|
||||
<!-- IntrmyAgt1Acct -->
|
||||
<!-- IntrmyAgt2 -->
|
||||
<!-- IntrmyAgt2Acct -->
|
||||
<!-- IntrmyAgt3 -->
|
||||
<!-- IntrmyAgt3Acct -->
|
||||
<CdtrAgt>
|
||||
${FinancialInstitution(payment.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</CdtrAgt>
|
||||
<!-- CdtrAgtAcct -->
|
||||
<Cdtr>
|
||||
${PartyIdentification(payment.party)}
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
${Account(payment.sepa_bank_account_number)}
|
||||
</CdtrAcct>
|
||||
<!-- UltmtCdtr -->
|
||||
<!-- InstrForCdtrAgt -->
|
||||
<!-- InstrForDbtrAgt -->
|
||||
<!-- Purp -->
|
||||
<!-- RgltryRptg -->
|
||||
<!-- Tax -->
|
||||
<!-- RltdRmtInf -->
|
||||
<RmtInf py:if="payment.sepa_remittance_information">
|
||||
<Ustrd>${payment.sepa_remittance_information[:140]}</Ustrd>
|
||||
</RmtInf>
|
||||
<!-- SplmtryData -->
|
||||
</CdtTrfTxInf>
|
||||
</PmtInf>
|
||||
<!-- SplmtryData -->
|
||||
</CstmrCdtTrfInitn>
|
||||
</Document>
|
||||
76
modules/account_payment_sepa/template/pain.001.003.03.xml
Normal file
76
modules/account_payment_sepa/template/pain.001.003.03.xml
Normal file
@@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.003.03"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.003.03
|
||||
pain.001.003.03.xsd"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:py="http://genshi.edgewall.org/">
|
||||
<xi:include href="base.xml"/>
|
||||
<xi:include href="base.003.xml"/>
|
||||
<CstmrCdtTrfInitn>
|
||||
<GrpHdr>
|
||||
<MsgId>${group.sepa_message_id[:35]}</MsgId>
|
||||
<CreDtTm>${datetime.datetime.now().replace(microsecond=0).isoformat()}</CreDtTm>
|
||||
<NbOfTxs>${sum(len(payments) for _, payments in group.sepa_payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in group.payments)}</CtrlSum>
|
||||
<InitgPty>
|
||||
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_payable_initiator_id, with_address=False)}
|
||||
</InitgPty>
|
||||
</GrpHdr>
|
||||
<PmtInf py:for="key, payments in group.sepa_payments">
|
||||
<PmtInfId>${key['payment_info'][:35]}</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<BtchBookg>${'true' if group.journal.sepa_batch_booking else 'false'}</BtchBookg>
|
||||
<NbOfTxs>${len(payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in payments)}</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<!-- InstrPrty -->
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
<!-- CtgyPurp -->
|
||||
</PmtTpInf>
|
||||
<ReqdExctnDt>${key['date'].isoformat()}</ReqdExctnDt>
|
||||
<Dbtr>
|
||||
${PartyIdentification(group.company.party)}
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
${Account(group.journal.sepa_bank_account_number)}
|
||||
</DbtrAcct>
|
||||
<DbtrAgt>
|
||||
${FinancialInstitution(group.journal.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</DbtrAgt>
|
||||
<!-- UltmtDbtr -->
|
||||
<ChrgBr>SLEV</ChrgBr>
|
||||
<CdtTrfTxInf py:for="payment in payments">
|
||||
<PmtId>
|
||||
<InstrId>${payment.sepa_instruction_id}</InstrId>
|
||||
<EndToEndId>${payment.sepa_end_to_end_id}</EndToEndId>
|
||||
</PmtId>
|
||||
<!-- PmtTpInf --> <!-- EPC only at payment information level -->
|
||||
<Amt>
|
||||
<InstdAmt py:attrs="{'Ccy': payment.currency.code}">${payment.amount}</InstdAmt>
|
||||
</Amt>
|
||||
<!-- ChrgBr --> <!-- EPC only at payment information level -->
|
||||
<!-- UltmtDbtr -->
|
||||
<CdtrAgt>
|
||||
${FinancialInstitution(payment.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</CdtrAgt>
|
||||
<Cdtr>
|
||||
${PartyIdentification(payment.party)}
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
${Account(payment.sepa_bank_account_number, with_ccy=False)}
|
||||
</CdtrAcct>
|
||||
<!-- UltmtCdtr -->
|
||||
<!-- Purp -->
|
||||
<RmtInf py:if="payment.sepa_remittance_information">
|
||||
<Ustrd>${normalize('NFKD', payment.sepa_remittance_information).encode('ascii', 'replace')[:140]}</Ustrd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
</PmtInf>
|
||||
</CstmrCdtTrfInitn>
|
||||
</Document>
|
||||
126
modules/account_payment_sepa/template/pain.008.001.02.xml
Normal file
126
modules/account_payment_sepa/template/pain.008.001.02.xml
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:py="http://genshi.edgewall.org/">
|
||||
<xi:include href="base.xml"/>
|
||||
<!-- version 2 uses BIC instead of BICFI -->
|
||||
<py:def function="FinancialInstitution(bank, only_bic=False)">
|
||||
<FinInstnId>
|
||||
<BIC py:if="bank.bic">${bank.bic}</BIC>
|
||||
<py:if test="not only_bic">
|
||||
<!-- ClrSysMmbId -->
|
||||
<Nm>${bank.party.name[:140]}</Nm>
|
||||
<py:with vars="address = bank.party.address_get()">
|
||||
<PstlAdr py:if="address">
|
||||
${PostalAddress(address)}
|
||||
</PstlAdr>
|
||||
</py:with>
|
||||
</py:if>
|
||||
<Othr py:if="not bank.bic">
|
||||
<Id>NOTPROVIDED</Id>
|
||||
</Othr>
|
||||
</FinInstnId>
|
||||
<!-- BrnchId -->
|
||||
</py:def>
|
||||
<CstmrDrctDbtInitn>
|
||||
<GrpHdr>
|
||||
<MsgId>${group.sepa_message_id[:35]}</MsgId>
|
||||
<CreDtTm>${datetime.datetime.now().replace(microsecond=0).isoformat()}</CreDtTm>
|
||||
<!-- Authstn -->
|
||||
<NbOfTxs>${sum(len(payments) for _, payments in group.sepa_payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in group.payments)}</CtrlSum>
|
||||
<!-- PmtTpInf -->
|
||||
<!-- ReqdColltnDt -->
|
||||
<InitgPty>
|
||||
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_receivable_initiator_id)}
|
||||
</InitgPty>
|
||||
<!-- FwdgAgt -->
|
||||
</GrpHdr>
|
||||
<PmtInf py:for="key, payments in group.sepa_payments">
|
||||
<PmtInfId>${key['payment_info'][:35]}</PmtInfId>
|
||||
<PmtMtd>DD</PmtMtd>
|
||||
<BtchBookg>${'true' if group.journal.sepa_batch_booking else 'false'}</BtchBookg>
|
||||
<NbOfTxs>${len(payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in payments)}</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<!-- InstrPrty -->
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
<!-- Prtry -->
|
||||
</SvcLvl>
|
||||
<LclInstrm>
|
||||
<Cd>${key['scheme']}</Cd>
|
||||
<!-- Prtry -->
|
||||
</LclInstrm>
|
||||
<SeqTp>${key['sequence_type']}</SeqTp>
|
||||
<!-- CtgyPurp -->
|
||||
</PmtTpInf>
|
||||
<ReqdColltnDt>${key['date'].isoformat()}</ReqdColltnDt>
|
||||
<Cdtr>
|
||||
${PartyIdentification(group.company.party)}
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
${Account(group.journal.sepa_bank_account_number)}
|
||||
</CdtrAcct>
|
||||
<CdtrAgt>
|
||||
${FinancialInstitution(group.journal.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</CdtrAgt>
|
||||
<!-- CdtrAgtAcct -->
|
||||
<!-- UltmtCdtr -->
|
||||
<ChrgBr>${group.journal.sepa_charge_bearer}</ChrgBr>
|
||||
<!-- ChrgsAcct -->
|
||||
<!-- ChrgsAcctAgt -->
|
||||
<CdtrSchmeId>
|
||||
${PartyIdentification(group.company.party, id='eu_at_02')}
|
||||
</CdtrSchmeId>
|
||||
<DrctDbtTxInf py:for="payment in payments">
|
||||
<PmtId>
|
||||
<InstrId>${payment.sepa_instruction_id}</InstrId>
|
||||
<EndToEndId>${payment.sepa_end_to_end_id}</EndToEndId>
|
||||
</PmtId>
|
||||
<!-- PmtTpInf -->
|
||||
<InstdAmt py:attrs="{'Ccy': payment.currency.code}">${payment.amount}</InstdAmt>
|
||||
<!-- ChrgBr --> <!-- EPC only at payment information level -->
|
||||
<DrctDbtTx>
|
||||
<MndtRltdInf py:with="mandate = payment.sepa_mandate">
|
||||
<MndtId>${mandate.identification}</MndtId>
|
||||
<DtOfSgntr>${mandate.signature_date.isoformat()}</DtOfSgntr>
|
||||
<!-- AmdmntInd -->
|
||||
<!-- AmdmntInfDtls -->
|
||||
<!-- ElctrncSgntr -->
|
||||
<!-- FrstColltnDt -->
|
||||
<!-- FnlColltnDt -->
|
||||
<!-- Frqcy -->
|
||||
</MndtRltdInf>
|
||||
<!-- CdtrSchmeId -->
|
||||
<!-- PreNtfctnId -->
|
||||
<!-- PreNtfctnDt -->
|
||||
</DrctDbtTx>
|
||||
<!-- UltmtCdtr -->
|
||||
<DbtrAgt>
|
||||
${FinancialInstitution(payment.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</DbtrAgt>
|
||||
<!-- DbtrAgtAcct -->
|
||||
<Dbtr>
|
||||
${PartyIdentification(payment.party)}
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
${Account(payment.sepa_bank_account_number, currency=False)}
|
||||
</DbtrAcct>
|
||||
<!-- UltmtDbtr -->
|
||||
<!-- InstrForCdtrAgt -->
|
||||
<!-- Purp -->
|
||||
<!-- RgltryRptg -->
|
||||
<!-- Tax -->
|
||||
<!-- RltdRmtInf -->
|
||||
<RmtInf py:if="payment.sepa_remittance_information">
|
||||
<Ustrd>${payment.sepa_remittance_information[:140]}</Ustrd>
|
||||
</RmtInf>
|
||||
</DrctDbtTxInf>
|
||||
</PmtInf>
|
||||
</CstmrDrctDbtInitn>
|
||||
</Document>
|
||||
109
modules/account_payment_sepa/template/pain.008.001.04.xml
Normal file
109
modules/account_payment_sepa/template/pain.008.001.04.xml
Normal file
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.04"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:py="http://genshi.edgewall.org/">
|
||||
<xi:include href="base.xml"/>
|
||||
<CstmrDrctDbtInitn>
|
||||
<GrpHdr>
|
||||
<MsgId>${group.sepa_message_id[:35]}</MsgId>
|
||||
<CreDtTm>${datetime.datetime.now().replace(microsecond=0).isoformat()}</CreDtTm>
|
||||
<!-- Authstn -->
|
||||
<NbOfTxs>${len(group.payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in group.payments)}</CtrlSum>
|
||||
<!-- PmtTpInf -->
|
||||
<!-- ReqdColltnDt -->
|
||||
<InitgPty>
|
||||
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_receivable_initiator_id)}
|
||||
</InitgPty>
|
||||
<!-- FwdgAgt -->
|
||||
</GrpHdr>
|
||||
<PmtInf py:for="key, payments in group.sepa_payments">
|
||||
<PmtInfId>${key['payment_info'][:35]}</PmtInfId>
|
||||
<PmtMtd>DD</PmtMtd>
|
||||
<BtchBookg>${'true' if group.journal.sepa_batch_booking else 'false'}</BtchBookg>
|
||||
<NbOfTxs>${len(payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in payments)}</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<!-- InstrPrty -->
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
<!-- Prtry -->
|
||||
</SvcLvl>
|
||||
<LclInstrm>
|
||||
<Cd>${key['scheme']}</Cd>
|
||||
<!-- Prtry -->
|
||||
</LclInstrm>
|
||||
<SeqTp>${key['sequence_type']}</SeqTp>
|
||||
<!-- CtgyPurp -->
|
||||
</PmtTpInf>
|
||||
<ReqdColltnDt>${key['date'].isoformat()}</ReqdColltnDt>
|
||||
<Cdtr>
|
||||
${PartyIdentification(group.company.party)}
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
${Account(group.journal.sepa_bank_account_number)}
|
||||
</CdtrAcct>
|
||||
<CdtrAgt>
|
||||
${FinancialInstitution(group.journal.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</CdtrAgt>
|
||||
<!-- CdtrAgtAcct -->
|
||||
<!-- UltmtCdtr -->
|
||||
<ChrgBr>${group.journal.sepa_charge_bearer}</ChrgBr>
|
||||
<!-- ChrgsAcct -->
|
||||
<!-- ChrgsAcctAgt -->
|
||||
<CdtrSchmeId>
|
||||
${PartyIdentification(group.company.party, id='eu_at_02')}
|
||||
</CdtrSchmeId>
|
||||
<DrctDbtTxInf py:for="payment in payments">
|
||||
<PmtId>
|
||||
<InstrId>${payment.sepa_instruction_id}</InstrId>
|
||||
<EndToEndId>${payment.sepa_end_to_end_id}</EndToEndId>
|
||||
</PmtId>
|
||||
<!-- PmtTpInf -->
|
||||
<InstdAmt py:attrs="{'Ccy': payment.currency.code}">${payment.amount}</InstdAmt>
|
||||
<!-- ChrgBr --> <!-- EPC only at payment information level -->
|
||||
<DrctDbtTx>
|
||||
<MndtRltdInf py:with="mandate = payment.sepa_mandate">
|
||||
<MndtId>${mandate.identification}</MndtId>
|
||||
<DtOfSgntr>${mandate.signature_date.isoformat()}</DtOfSgntr>
|
||||
<!-- AmdmntInd -->
|
||||
<!-- AmdmntInfDtls -->
|
||||
<!-- ElctrncSgntr -->
|
||||
<!-- FrstColltnDt -->
|
||||
<!-- FnlColltnDt -->
|
||||
<!-- Frqcy -->
|
||||
</MndtRltdInf>
|
||||
<!-- CdtrSchmeId -->
|
||||
<!-- PreNtfctnId -->
|
||||
<!-- PreNtfctnDt -->
|
||||
</DrctDbtTx>
|
||||
<!-- UltmtCdtr -->
|
||||
<DbtrAgt>
|
||||
${FinancialInstitution(payment.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</DbtrAgt>
|
||||
<!-- DbtrAgtAcct -->
|
||||
<Dbtr>
|
||||
${PartyIdentification(payment.party)}
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
${Account(payment.sepa_bank_account_number, currency=False)}
|
||||
</DbtrAcct>
|
||||
<!-- UltmtDbtr -->
|
||||
<!-- InstrForCdtrAgt -->
|
||||
<!-- Purp -->
|
||||
<!-- RgltryRptg -->
|
||||
<!-- Tax -->
|
||||
<!-- RltdRmtInf -->
|
||||
<RmtInf py:if="payment.sepa_remittance_information">
|
||||
<Ustrd>${payment.sepa_remittance_information[:140]}</Ustrd>
|
||||
</RmtInf>
|
||||
<!-- SplmtryData -->
|
||||
</DrctDbtTxInf>
|
||||
</PmtInf>
|
||||
<!-- SplmtryData -->
|
||||
</CstmrDrctDbtInitn>
|
||||
</Document>
|
||||
90
modules/account_payment_sepa/template/pain.008.003.02.xml
Normal file
90
modules/account_payment_sepa/template/pain.008.003.02.xml
Normal file
@@ -0,0 +1,90 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02"
|
||||
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02
|
||||
pain.008.003.02.xsd"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:py="http://genshi.edgewall.org/">
|
||||
<xi:include href="base.xml"/>
|
||||
<xi:include href="base.003.xml"/>
|
||||
<CstmrDrctDbtInitn>
|
||||
<GrpHdr>
|
||||
<MsgId>${group.sepa_message_id[:35]}</MsgId>
|
||||
<CreDtTm>${datetime.datetime.now().replace(microsecond=0).isoformat()}</CreDtTm>
|
||||
<NbOfTxs>${sum(len(payments) for _, payments in group.sepa_payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in group.payments)}</CtrlSum>
|
||||
<InitgPty>
|
||||
${PartyIdentification(group.sepa_initiating_party, id=group.journal.sepa_receivable_initiator_id, with_address=False)}
|
||||
</InitgPty>
|
||||
</GrpHdr>
|
||||
<PmtInf py:for="key, payments in group.sepa_payments">
|
||||
<PmtInfId>${key['payment_info'][:35]}</PmtInfId>
|
||||
<PmtMtd>DD</PmtMtd>
|
||||
<BtchBookg>${'true' if group.journal.sepa_batch_booking else 'false'}</BtchBookg>
|
||||
<NbOfTxs>${len(payments)}</NbOfTxs>
|
||||
<CtrlSum>${sum(p.amount for p in payments)}</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
<LclInstrm>
|
||||
<Cd>${key['scheme']}</Cd>
|
||||
</LclInstrm>
|
||||
<SeqTp>${key['sequence_type']}</SeqTp>
|
||||
<!-- CtgyPurp -->
|
||||
</PmtTpInf>
|
||||
<ReqdColltnDt>${key['date'].isoformat()}</ReqdColltnDt>
|
||||
<Cdtr>
|
||||
${PartyIdentification(group.company.party)}
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
${Account(group.journal.sepa_bank_account_number)}
|
||||
</CdtrAcct>
|
||||
<CdtrAgt>
|
||||
${FinancialInstitution(group.journal.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</CdtrAgt>
|
||||
<!-- UltmtCdtr -->
|
||||
<ChrgBr>SLEV</ChrgBr>
|
||||
<CdtrSchmeId>
|
||||
${PartyIdentification(group.company.party, id='eu_at_02', with_name=False, with_address=False)}
|
||||
</CdtrSchmeId>
|
||||
<DrctDbtTxInf py:for="payment in payments">
|
||||
<PmtId>
|
||||
<InstrId>${payment.sepa_instruction_id}</InstrId>
|
||||
<EndToEndId>${payment.sepa_end_to_end_id}</EndToEndId>
|
||||
</PmtId>
|
||||
<InstdAmt py:attrs="{'Ccy': payment.currency.code}">${payment.amount}</InstdAmt>
|
||||
<!-- ChrgBr --> <!-- EPC only at payment information level -->
|
||||
<DrctDbtTx>
|
||||
<MndtRltdInf py:with="mandate = payment.sepa_mandate">
|
||||
<MndtId>${mandate.identification}</MndtId>
|
||||
<DtOfSgntr>${mandate.signature_date.isoformat()}</DtOfSgntr>
|
||||
<!-- AmdmntInd -->
|
||||
<!-- AmdmntInfDtls -->
|
||||
<!-- ElctrncSgntr -->
|
||||
</MndtRltdInf>
|
||||
<!-- CdtrSchmeId -->
|
||||
</DrctDbtTx>
|
||||
<!-- UltmtCdtr -->
|
||||
<DbtrAgt>
|
||||
${FinancialInstitution(payment.sepa_bank_account_number.account.bank, only_bic=True)}
|
||||
</DbtrAgt>
|
||||
<Dbtr>
|
||||
${PartyIdentification(payment.party)}
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
${Account(payment.sepa_bank_account_number, with_ccy=False)}
|
||||
</DbtrAcct>
|
||||
<!-- UltmtDbtr -->
|
||||
<!-- Purp -->
|
||||
<RmtInf py:if="payment.sepa_remittance_information">
|
||||
<Ustrd>${normalize('NFKD', payment.sepa_remittance_information).encode('ascii', 'replace')[:140]}</Ustrd>
|
||||
<!-- Strd -->
|
||||
</RmtInf>
|
||||
</DrctDbtTxInf>
|
||||
</PmtInf>
|
||||
</CstmrDrctDbtInitn>
|
||||
</Document>
|
||||
Reference in New Issue
Block a user