fixed sepa problem with 2 digits
This commit is contained in:
parent
64fe94c261
commit
f1abeea212
9 changed files with 921 additions and 200 deletions
|
|
@ -47,12 +47,14 @@ public class TestSEPATransform {
|
|||
/**
|
||||
* XSL Transformation for SEPA file for Bank Polski
|
||||
*
|
||||
* We also test the two-digits case. 10,5 need to become 10,50
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
@Test
|
||||
public void testBankPolski() throws IOException {
|
||||
String MODEL_PATH_XML = "sepa/beispiel-daten.xml";
|
||||
String MODEL_PATH_XSL = "sepa/sepa-2.0.5-pl.xsl";
|
||||
String MODEL_PATH_XSL = "sepa/sepa-2.0.6-pl.xsl";
|
||||
try {
|
||||
XSLTester.transform(MODEL_PATH_XML, MODEL_PATH_XSL, "../reports/sepa/result_sepa02.xml");
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,54 @@
|
|||
<data xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
|
||||
|
||||
<document>
|
||||
<item name="$processid">
|
||||
<value xsi:type="xs:int">210</value>
|
||||
</item>
|
||||
<item name="$uniqueid">
|
||||
<value xsi:type="xs:string">bf073e72-512c-4d60-af77-4427f0872036</value>
|
||||
<value xsi:type="xs:string">bf073e72asdf-512c-4d60-af77-40872036</value>
|
||||
</item>
|
||||
<item name="$modelversion">
|
||||
<value xsi:type="xs:string">sepa-export-de-1.0</value>
|
||||
</item>
|
||||
<item name="$workflowgroup">
|
||||
<value xsi:type="xs:string">SEPA-Export</value>
|
||||
</item>
|
||||
<item name="$workflowsummary">
|
||||
<value xsi:type="xs:string">SEPA Export (EUR)</value>
|
||||
</item>
|
||||
<item name="numsequencenumber">
|
||||
<value xsi:type="xs:string">3453540000</value>
|
||||
</item>
|
||||
<item name="cdtr.bic">
|
||||
<value xsi:type="xs:string">XXXADEMM</value>
|
||||
</item>
|
||||
<item name="cdtr.iban">
|
||||
<value xsi:type="xs:string">DE74 5555 0000 0000 0552 73</value>
|
||||
</item>
|
||||
<item name="cdtr.name">
|
||||
<value xsi:type="xs:string">Supplier 2 Eyy XXXXXXXXX</value>
|
||||
</item>
|
||||
<item name="dbtr.bic">
|
||||
<value xsi:type="xs:string">AAXADEMM</value>
|
||||
</item>
|
||||
<item name="dbtr.iban">
|
||||
<value xsi:type="xs:string">SA11 5555 0000 0000 0552 73</value>
|
||||
</item>
|
||||
<item name="dbtr.name">
|
||||
<value xsi:type="xs:string">Targo Bank</value>
|
||||
</item>
|
||||
|
||||
</document>
|
||||
|
||||
|
||||
<document>
|
||||
<item name="$processid">
|
||||
<value xsi:type="xs:int">210</value>
|
||||
</item>
|
||||
<item name="$uniqueid">
|
||||
<value xsi:type="xs:string">bf073e72-512c-4d60-af77-4427f0872031</value>
|
||||
</item>
|
||||
<item name="$modelversion">
|
||||
<value xsi:type="xs:string">rechnungseingang-3.0</value>
|
||||
|
|
@ -25,7 +67,8 @@
|
|||
<value xsi:type="xs:string">DE74 5555 0000 0000 0282 73</value>
|
||||
</item>
|
||||
<item name="cdtr.name">
|
||||
<value xsi:type="xs:string">Supplier 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Eyy XXXXXXXXX</value>
|
||||
<value xsi:type="xs:string">Supplier 1
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Eyy XXXXXXXXX</value>
|
||||
</item>
|
||||
<item name="dbtr.bic">
|
||||
<value xsi:nil="true" />
|
||||
|
|
@ -46,11 +89,59 @@
|
|||
<value xsi:type="xs:string">202007000175</value>
|
||||
</item>
|
||||
<item name="invoice.total">
|
||||
<value xsi:type="xs:decimal">86.87</value>
|
||||
<value xsi:type="xs:decimal">290.40</value>
|
||||
</item>
|
||||
</document>
|
||||
|
||||
|
||||
<document>
|
||||
<item name="$processid">
|
||||
<value xsi:type="xs:int">210</value>
|
||||
</item>
|
||||
<item name="$uniqueid">
|
||||
<value xsi:type="xs:string">bf073e72-512c-4d60-af77-4427f0872035</value>
|
||||
</item>
|
||||
<item name="$modelversion">
|
||||
<value xsi:type="xs:string">rechnungseingang-3.0</value>
|
||||
</item>
|
||||
<item name="$workflowgroup">
|
||||
<value xsi:type="xs:string">Rechnungseingang</value>
|
||||
</item>
|
||||
<item name="$workflowsummary">
|
||||
<value xsi:type="xs:string">Invoice Example-1</value>
|
||||
</item>
|
||||
<item name="cdtr.bic">
|
||||
<value xsi:type="xs:string">XXXADEMM</value>
|
||||
</item>
|
||||
<item name="cdtr.iban">
|
||||
<value xsi:type="xs:string">DE74 5555 0000 0000 0282 73</value>
|
||||
</item>
|
||||
<item name="cdtr.name">
|
||||
<value xsi:type="xs:string">Supplier 1
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Eyy XXXXXXXXX</value>
|
||||
</item>
|
||||
<item name="dbtr.bic">
|
||||
<value xsi:nil="true" />
|
||||
</item>
|
||||
<item name="dbtr.iban">
|
||||
<value xsi:nil="true" />
|
||||
</item>
|
||||
<item name="dbtr.name">
|
||||
<value xsi:nil="true" />
|
||||
</item>
|
||||
<item name="invoice.currency">
|
||||
<value xsi:type="xs:string">EUR</value>
|
||||
</item>
|
||||
<item name="invoice.date">
|
||||
<value xsi:type="xs:dateTime">2020-07-07T00:00:00+02:00</value>
|
||||
</item>
|
||||
<item name="invoice.number">
|
||||
<value xsi:type="xs:string">202007000175</value>
|
||||
</item>
|
||||
<item name="invoice.total">
|
||||
<value xsi:type="xs:decimal">292.44</value>
|
||||
</item>
|
||||
</document>
|
||||
|
||||
<document>
|
||||
<item name="$processid">
|
||||
|
|
@ -99,65 +190,9 @@
|
|||
<value xsi:type="xs:string">202007000175</value>
|
||||
</item>
|
||||
<item name="invoice.total">
|
||||
<value xsi:type="xs:decimal">50.00</value>
|
||||
<value xsi:type="xs:decimal">73.06</value>
|
||||
</item>
|
||||
</document>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<document>
|
||||
<item name="$workflowgroup">
|
||||
<value xsi:type="xs:string">SEPA-Export</value>
|
||||
</item>
|
||||
<item name="$modelversion">
|
||||
<value xsi:type="xs:string">sepa-export-de-1.0.0</value>
|
||||
</item>
|
||||
<item name="$processid">
|
||||
<value xsi:type="xs:int">1000</value>
|
||||
</item>
|
||||
<item name="$taskid">
|
||||
<value xsi:type="xs:int">1000</value>
|
||||
</item>
|
||||
<item name="$uniqueid">
|
||||
<value xsi:type="xs:string">a8a5a0fa-48bd-49d4-987d-bda597c66055</value>
|
||||
</item>
|
||||
<item name="dbtr.bic">
|
||||
<value xsi:type="xs:string">OOBADEFFXXX</value>
|
||||
</item>
|
||||
<item name="dbtr.iban">
|
||||
<value xsi:type="xs:string">DE07 500 4 0000 0582 5070 42</value>
|
||||
</item>
|
||||
<item name="_scheduler_log">
|
||||
<value xsi:type="xs:string">Invoice: 6b3aedd7-209c-4b4a-b771-37783257db78
|
||||
added.
|
||||
</value>
|
||||
<value xsi:type="xs:string">Invoice: 45229284-20f9-4ff4-8efb-249eb0251ebb
|
||||
added.
|
||||
</value>
|
||||
<value xsi:type="xs:string">Invoice: 9cf48434-8c39-438f-b053-14afd7e70032
|
||||
added.
|
||||
</value>
|
||||
<value xsi:type="xs:string">Invoice: 78e89726-b7b2-41fe-9964-7f62c3837f01
|
||||
added.
|
||||
</value>
|
||||
</item>
|
||||
<item name="$workflowsummary">
|
||||
<value xsi:type="xs:string">Muster GmbH</value>
|
||||
</item>
|
||||
<item name="$workitemref">
|
||||
<value xsi:type="xs:string">6b3aedd7-209c-4b4a-b771-37783257db78</value>
|
||||
<value xsi:type="xs:string">45229284-20f9-4ff4-8efb-249eb0251ebb</value>
|
||||
<value xsi:type="xs:string">9cf48434-8c39-438f-b053-14afd7e70032</value>
|
||||
<value xsi:type="xs:string">78e89726-b7b2-41fe-9964-7f62c3837f01</value>
|
||||
</item>
|
||||
<item name="dbtr.name">
|
||||
<value xsi:type="xs:string">Muster AG</value>
|
||||
</item>
|
||||
</document>
|
||||
</data>
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.003.03"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.003.03 pain.001.003.03.xsd">
|
||||
<CstmrCdtTrfInitn>
|
||||
<GrpHdr>
|
||||
<MsgId>a8a5a0fa48bd49d4987dbda597c66055</MsgId>
|
||||
<CreDtTm>2024-02-26T11:07:43</CreDtTm>
|
||||
<NbOfTxs>2</NbOfTxs>
|
||||
<CtrlSum>136.87</CtrlSum>
|
||||
<InitgPty>
|
||||
<Nm>Muster AG</Nm>
|
||||
</InitgPty>
|
||||
</GrpHdr>
|
||||
<PmtInf>
|
||||
<PmtInfId>a8a5a0fa48bd49d4987dbda597c66055-1</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<NbOfTxs>2</NbOfTxs>
|
||||
<CtrlSum>136.87</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
</PmtTpInf>
|
||||
<ReqdExctnDt>2024-02-26</ReqdExctnDt>
|
||||
<Dbtr>
|
||||
<Nm>Muster AG</Nm>
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
<Id>
|
||||
<IBAN>DE07500400000582507042</IBAN>
|
||||
</Id>
|
||||
</DbtrAcct>
|
||||
<DbtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>OOBADEFFXXX</BIC>
|
||||
</FinInstnId>
|
||||
</DbtrAgt>
|
||||
<ChrgBr>SLEV</ChrgBr>
|
||||
<CdtTrfTxInf>
|
||||
<PmtId>
|
||||
<EndToEndId>NOTPROVIDED</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt Ccy="EUR">86.87</InstdAmt>
|
||||
</Amt>
|
||||
<CdtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>XXXADEMM</BIC>
|
||||
</FinInstnId>
|
||||
</CdtrAgt>
|
||||
<Cdtr>
|
||||
<Nm>Supplier 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx E</Nm>
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
<Id>
|
||||
<IBAN>DE74555500000000028273</IBAN>
|
||||
</Id>
|
||||
</CdtrAcct>
|
||||
<RmtInf>
|
||||
<Ustrd>Invoice Example-1</Ustrd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
<CdtTrfTxInf>
|
||||
<PmtId>
|
||||
<EndToEndId>NOTPROVIDED</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt Ccy="EUR">50</InstdAmt>
|
||||
</Amt>
|
||||
<CdtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>XXXADEMM</BIC>
|
||||
</FinInstnId>
|
||||
</CdtrAgt>
|
||||
<Cdtr>
|
||||
<Nm>Supplier 2 Eyy XXXXXXXXX</Nm>
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
<Id>
|
||||
<IBAN>DE74555500000000055273</IBAN>
|
||||
</Id>
|
||||
</CdtrAcct>
|
||||
<RmtInf>
|
||||
<Ustrd>3453540000 / 202007000175</Ustrd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
</PmtInf>
|
||||
</CstmrCdtTrfInitn>
|
||||
</Document>
|
||||
|
|
@ -5,36 +5,36 @@
|
|||
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03 pain.001.001.03.xsd">
|
||||
<CstmrCdtTrfInitn>
|
||||
<GrpHdr>
|
||||
<MsgId>a8a5a0fa48bd49d4987dbda597c66055</MsgId>
|
||||
<CreDtTm>2024-02-26T11:15:26</CreDtTm>
|
||||
<NbOfTxs>2</NbOfTxs>
|
||||
<CtrlSum>136.87</CtrlSum>
|
||||
<MsgId>bf073e72asdf512c4d60af7740872036</MsgId>
|
||||
<CreDtTm>2024-03-04T08:50:19</CreDtTm>
|
||||
<NbOfTxs>3</NbOfTxs>
|
||||
<CtrlSum>655.90</CtrlSum>
|
||||
<InitgPty>
|
||||
<Nm>Muster AG</Nm>
|
||||
<Nm>Targo Bank</Nm>
|
||||
</InitgPty>
|
||||
</GrpHdr>
|
||||
<PmtInf>
|
||||
<PmtInfId>a8a5a0fa48bd49d4987dbda597c66055-1</PmtInfId>
|
||||
<PmtInfId>bf073e72asdf512c4d60af7740872036-1</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<NbOfTxs>2</NbOfTxs>
|
||||
<CtrlSum>136.87</CtrlSum>
|
||||
<NbOfTxs>3</NbOfTxs>
|
||||
<CtrlSum>655.90</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
</PmtTpInf>
|
||||
<ReqdExctnDt>2024-02-26</ReqdExctnDt>
|
||||
<ReqdExctnDt>2024-03-04</ReqdExctnDt>
|
||||
<Dbtr>
|
||||
<Nm>Muster AG</Nm>
|
||||
<Nm>Targo Bank</Nm>
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
<Id>
|
||||
<IBAN>DE07500400000582507042</IBAN>
|
||||
<IBAN>SA11555500000000055273</IBAN>
|
||||
</Id>
|
||||
</DbtrAcct>
|
||||
<DbtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>OOBADEFFXXX</BIC>
|
||||
<BIC>AAXADEMM</BIC>
|
||||
</FinInstnId>
|
||||
</DbtrAgt>
|
||||
<ChrgBr>SHAR</ChrgBr>
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
<EndToEndId>NOTPROVIDED</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt Ccy="EUR">86.87</InstdAmt>
|
||||
<InstdAmt Ccy="EUR">290.40</InstdAmt>
|
||||
</Amt>
|
||||
<CdtrAgt>
|
||||
<FinInstnId>
|
||||
|
|
@ -51,7 +51,8 @@
|
|||
</FinInstnId>
|
||||
</CdtrAgt>
|
||||
<Cdtr>
|
||||
<Nm>Supplier 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx E</Nm>
|
||||
<Nm>Supplier 1
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Nm>
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
<Id>
|
||||
|
|
@ -67,7 +68,32 @@
|
|||
<EndToEndId>NOTPROVIDED</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt Ccy="EUR">50</InstdAmt>
|
||||
<InstdAmt Ccy="EUR">292.44</InstdAmt>
|
||||
</Amt>
|
||||
<CdtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>XXXADEMM</BIC>
|
||||
</FinInstnId>
|
||||
</CdtrAgt>
|
||||
<Cdtr>
|
||||
<Nm>Supplier 1
|
||||
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</Nm>
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
<Id>
|
||||
<IBAN>DE74555500000000028273</IBAN>
|
||||
</Id>
|
||||
</CdtrAcct>
|
||||
<RmtInf>
|
||||
<Ustrd>Invoice Example-1</Ustrd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
<CdtTrfTxInf>
|
||||
<PmtId>
|
||||
<EndToEndId>NOTPROVIDED</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt Ccy="EUR">73.06</InstdAmt>
|
||||
</Amt>
|
||||
<CdtrAgt>
|
||||
<FinInstnId>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
select="xs:decimal(sum(/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]/item[@name='invoice.total']/value))" />
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:variable name="total"
|
||||
select="xs:decimal(round-half-to-even($totalsum, 2))" />
|
||||
select="format-number(xs:decimal(round-half-to-even($totalsum, 2)), '0.00')" />
|
||||
|
||||
<!-- shortcut for the sepa export document -->
|
||||
<xsl:variable name="exportWorkitem"
|
||||
|
|
@ -37,8 +37,10 @@
|
|||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='$uniqueid']/value, '-', '')" />
|
||||
</MsgId>
|
||||
<CreDtTm><xsl:value-of
|
||||
select="format-dateTime($now, '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]')" /></CreDtTm>
|
||||
<CreDtTm>
|
||||
<xsl:value-of
|
||||
select="format-dateTime($now, '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]')" />
|
||||
</CreDtTm>
|
||||
<NbOfTxs>
|
||||
<xsl:value-of select="$count" />
|
||||
</NbOfTxs>
|
||||
|
|
@ -57,14 +59,15 @@
|
|||
<PmtInf>
|
||||
<PmtInfId>
|
||||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='$uniqueid']/value, '-', '')" /><xsl:text>-1</xsl:text>
|
||||
select="replace($exportWorkitem/item[@name='$uniqueid']/value, '-', '')" />
|
||||
<xsl:text>-1</xsl:text>
|
||||
</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<NbOfTxs>
|
||||
<xsl:value-of select="$count" />
|
||||
</NbOfTxs>
|
||||
<CtrlSum>
|
||||
<!-- round to 2 digits -->
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:value-of select="$total" />
|
||||
</CtrlSum>
|
||||
<PmtTpInf>
|
||||
|
|
@ -72,8 +75,10 @@
|
|||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
</PmtTpInf>
|
||||
<ReqdExctnDt><xsl:value-of
|
||||
select="format-dateTime($now, '[Y0001]-[M01]-[D01]')" /></ReqdExctnDt>
|
||||
<ReqdExctnDt>
|
||||
<xsl:value-of
|
||||
select="format-dateTime($now, '[Y0001]-[M01]-[D01]')" />
|
||||
</ReqdExctnDt>
|
||||
<Dbtr>
|
||||
<Nm>
|
||||
<xsl:value-of
|
||||
|
|
@ -106,8 +111,6 @@
|
|||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- This template builds sepa header info -->
|
||||
<xsl:template
|
||||
match="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'SEPA-Export']">
|
||||
|
|
@ -115,25 +118,24 @@
|
|||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- This template builds sepa payment info for each invoice -->
|
||||
<xsl:template
|
||||
match="/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]">
|
||||
|
||||
<!-- round to 2 digits - geht nur mit sum funktion -->
|
||||
<xsl:variable name="wert1"
|
||||
select="xs:decimal(sum(item[@name='invoice.total']/value))" />
|
||||
<xsl:variable name="wert2"
|
||||
select="xs:decimal(round-half-to-even($wert1,2))" />
|
||||
<CdtTrfTxInf xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.003.03">
|
||||
<xsl:variable
|
||||
name="wert2"
|
||||
select="format-number(xs:decimal(round-half-to-even(item[@name='invoice.total']/value, 2)), '0.00')" />
|
||||
|
||||
<CdtTrfTxInf
|
||||
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.003.03">
|
||||
<PmtId>
|
||||
<EndToEndId>NOTPROVIDED</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt>
|
||||
<xsl:attribute name="Ccy"><xsl:value-of
|
||||
select="item[@name='invoice.currency']/value" /></xsl:attribute>
|
||||
select="item[@name='invoice.currency']/value" /></xsl:attribute>
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:value-of select="$wert2" />
|
||||
</InstdAmt>
|
||||
|
|
@ -162,15 +164,18 @@
|
|||
<!-- Max140Text -->
|
||||
<Ustrd>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(item[@name='numsequencenumber']/value) > 0">
|
||||
<!-- neues format buchungsnummer / rechn.nr -->
|
||||
<xsl:value-of select="item[@name='numsequencenumber']/value" /><xsl:text> / </xsl:text><xsl:value-of select="item[@name='invoice.number']/value" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- fallback -->
|
||||
<xsl:value-of select="substring(item[@name='$workflowsummary']/value, 1, 140)" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
<xsl:when test="string-length(item[@name='numsequencenumber']/value) > 0">
|
||||
<!-- neues format buchungsnummer / rechn.nr -->
|
||||
<xsl:value-of
|
||||
select="item[@name='numsequencenumber']/value" /><xsl:text> / </xsl:text><xsl:value-of
|
||||
select="item[@name='invoice.number']/value" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- fallback -->
|
||||
<xsl:value-of
|
||||
select="substring(item[@name='$workflowsummary']/value, 1, 140)" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</Ustrd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
|
|
|
|||
187
reports/sepa/sepa-2.0.6-pl.imixs-report
Normal file
187
reports/sepa/sepa-2.0.6-pl.imixs-report
Normal file
File diff suppressed because one or more lines are too long
187
reports/sepa/sepa-2.0.6-pl.xsl
Normal file
187
reports/sepa/sepa-2.0.6-pl.xsl
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
version="2.0">
|
||||
<xsl:strip-space elements="*" />
|
||||
<xsl:output method="xml" indent="yes" encoding="UTF-8" standalone="yes" />
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:variable name="now" select="current-dateTime()" />
|
||||
|
||||
<Document
|
||||
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03 pain.001.001.03.xsd">
|
||||
<CstmrCdtTrfInitn>
|
||||
|
||||
<!-- generate header info -->
|
||||
<!-- compute count of invoices -->
|
||||
<xsl:variable name="count"
|
||||
select="count(/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]/item[@name='$uniqueid']/value)" />
|
||||
<!-- compute total amount -->
|
||||
<xsl:variable name="totalsum"
|
||||
select="xs:decimal(sum(/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]/item[@name='invoice.total']/value))" />
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:variable name="total"
|
||||
select="format-number(xs:decimal(round-half-to-even($totalsum, 2)), '0.00')" />
|
||||
|
||||
<!-- shortcut for the sepa export document -->
|
||||
<xsl:variable name="exportWorkitem"
|
||||
select="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'SEPA-Export']" />
|
||||
|
||||
<GrpHdr>
|
||||
<MsgId>
|
||||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='$uniqueid']/value, '-', '')" />
|
||||
</MsgId>
|
||||
<CreDtTm>
|
||||
<xsl:value-of
|
||||
select="format-dateTime($now, '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]')" />
|
||||
</CreDtTm>
|
||||
<NbOfTxs>
|
||||
<xsl:value-of select="$count" />
|
||||
</NbOfTxs>
|
||||
<CtrlSum>
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:value-of select="$total" />
|
||||
</CtrlSum>
|
||||
<InitgPty>
|
||||
<Nm>
|
||||
<xsl:value-of
|
||||
select="$exportWorkitem/item[@name='dbtr.name']/value" />
|
||||
</Nm>
|
||||
</InitgPty>
|
||||
</GrpHdr>
|
||||
|
||||
<PmtInf>
|
||||
<PmtInfId>
|
||||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='$uniqueid']/value, '-', '')" />
|
||||
<xsl:text>-1</xsl:text>
|
||||
</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<NbOfTxs>
|
||||
<xsl:value-of select="$count" />
|
||||
</NbOfTxs>
|
||||
<CtrlSum>
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:value-of select="$total" />
|
||||
</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
</PmtTpInf>
|
||||
<ReqdExctnDt>
|
||||
<xsl:value-of
|
||||
select="format-dateTime($now, '[Y0001]-[M01]-[D01]')" />
|
||||
</ReqdExctnDt>
|
||||
<Dbtr>
|
||||
<Nm>
|
||||
<xsl:value-of
|
||||
select="$exportWorkitem/item[@name='dbtr.name']/value" />
|
||||
</Nm>
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
<Id>
|
||||
<IBAN>
|
||||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='dbtr.iban']/value, ' ', '')" />
|
||||
</IBAN>
|
||||
</Id>
|
||||
</DbtrAcct>
|
||||
<DbtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>
|
||||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='dbtr.bic']/value, ' ', '')" />
|
||||
</BIC>
|
||||
</FinInstnId>
|
||||
</DbtrAgt>
|
||||
<!--
|
||||
SHAR – Charges are shared between debtor and creditor
|
||||
SLEV – Charges are handled according to service level
|
||||
-->
|
||||
<ChrgBr>SHAR</ChrgBr>
|
||||
<!-- generate CdtTrfTxInf for each invoice -->
|
||||
<xsl:apply-templates
|
||||
select="/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]" />
|
||||
</PmtInf>
|
||||
</CstmrCdtTrfInitn>
|
||||
</Document>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- This template builds sepa header info -->
|
||||
<xsl:template
|
||||
match="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'SEPA-Export']">
|
||||
<!-- not in use -->
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- This template builds sepa payment info for each invoice -->
|
||||
<xsl:template
|
||||
match="/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]">
|
||||
|
||||
<!-- round to 2 digits - geht nur mit sum funktion -->
|
||||
<xsl:variable
|
||||
name="wert2"
|
||||
select="format-number(xs:decimal(round-half-to-even(item[@name='invoice.total']/value, 2)), '0.00')" />
|
||||
|
||||
<CdtTrfTxInf
|
||||
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
|
||||
<PmtId>
|
||||
<EndToEndId>NOTPROVIDED</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt>
|
||||
<xsl:attribute name="Ccy"><xsl:value-of
|
||||
select="item[@name='invoice.currency']/value" /></xsl:attribute>
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:value-of select="$wert2" />
|
||||
</InstdAmt>
|
||||
</Amt>
|
||||
<CdtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>
|
||||
<xsl:value-of select="replace(item[@name='cdtr.bic']/value, ' ', '')" />
|
||||
</BIC>
|
||||
</FinInstnId>
|
||||
</CdtrAgt>
|
||||
<Cdtr>
|
||||
<!-- MAX70 -->
|
||||
<Nm>
|
||||
<xsl:value-of select="substring(item[@name='cdtr.name']/value, 1, 70)" />
|
||||
</Nm>
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
<Id>
|
||||
<IBAN>
|
||||
<xsl:value-of select="replace(item[@name='cdtr.iban']/value, ' ', '')" />
|
||||
</IBAN>
|
||||
</Id>
|
||||
</CdtrAcct>
|
||||
<RmtInf>
|
||||
<!-- Max140Text -->
|
||||
<Ustrd>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(item[@name='numsequencenumber']/value) > 0">
|
||||
<!-- neues format buchungsnummer / rechn.nr -->
|
||||
<xsl:value-of
|
||||
select="item[@name='numsequencenumber']/value" /><xsl:text> / </xsl:text><xsl:value-of
|
||||
select="item[@name='invoice.number']/value" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- fallback -->
|
||||
<xsl:value-of
|
||||
select="substring(item[@name='$workflowsummary']/value, 1, 140)" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</Ustrd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
185
reports/sepa/sepa-2.0.6.imixs-report
Normal file
185
reports/sepa/sepa-2.0.6.imixs-report
Normal file
File diff suppressed because one or more lines are too long
185
reports/sepa/sepa-2.0.6.xsl
Normal file
185
reports/sepa/sepa-2.0.6.xsl
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<xsl:stylesheet
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
version="2.0">
|
||||
<xsl:strip-space elements="*" />
|
||||
<xsl:output method="xml" indent="yes" encoding="UTF-8" standalone="yes" />
|
||||
|
||||
<xsl:template match="/">
|
||||
|
||||
<xsl:variable name="now" select="current-dateTime()" />
|
||||
|
||||
|
||||
<Document
|
||||
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.003.03"
|
||||
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">
|
||||
<CstmrCdtTrfInitn>
|
||||
|
||||
<!-- generate header info -->
|
||||
<!-- compute count of invoices -->
|
||||
<xsl:variable name="count"
|
||||
select="count(/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]/item[@name='$uniqueid']/value)" />
|
||||
<!-- compute total amount -->
|
||||
<xsl:variable name="totalsum"
|
||||
select="xs:decimal(sum(/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]/item[@name='invoice.total']/value))" />
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:variable name="total"
|
||||
select="format-number(xs:decimal(round-half-to-even($totalsum, 2)), '0.00')" />
|
||||
|
||||
<!-- shortcut for the sepa export document -->
|
||||
<xsl:variable name="exportWorkitem"
|
||||
select="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'SEPA-Export']" />
|
||||
|
||||
<GrpHdr>
|
||||
<MsgId>
|
||||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='$uniqueid']/value, '-', '')" />
|
||||
</MsgId>
|
||||
<CreDtTm>
|
||||
<xsl:value-of
|
||||
select="format-dateTime($now, '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]')" />
|
||||
</CreDtTm>
|
||||
<NbOfTxs>
|
||||
<xsl:value-of select="$count" />
|
||||
</NbOfTxs>
|
||||
<CtrlSum>
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:value-of select="$total" />
|
||||
</CtrlSum>
|
||||
<InitgPty>
|
||||
<Nm>
|
||||
<xsl:value-of
|
||||
select="$exportWorkitem/item[@name='dbtr.name']/value" />
|
||||
</Nm>
|
||||
</InitgPty>
|
||||
</GrpHdr>
|
||||
|
||||
<PmtInf>
|
||||
<PmtInfId>
|
||||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='$uniqueid']/value, '-', '')" />
|
||||
<xsl:text>-1</xsl:text>
|
||||
</PmtInfId>
|
||||
<PmtMtd>TRF</PmtMtd>
|
||||
<NbOfTxs>
|
||||
<xsl:value-of select="$count" />
|
||||
</NbOfTxs>
|
||||
<CtrlSum>
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:value-of select="$total" />
|
||||
</CtrlSum>
|
||||
<PmtTpInf>
|
||||
<SvcLvl>
|
||||
<Cd>SEPA</Cd>
|
||||
</SvcLvl>
|
||||
</PmtTpInf>
|
||||
<ReqdExctnDt>
|
||||
<xsl:value-of
|
||||
select="format-dateTime($now, '[Y0001]-[M01]-[D01]')" />
|
||||
</ReqdExctnDt>
|
||||
<Dbtr>
|
||||
<Nm>
|
||||
<xsl:value-of
|
||||
select="$exportWorkitem/item[@name='dbtr.name']/value" />
|
||||
</Nm>
|
||||
</Dbtr>
|
||||
<DbtrAcct>
|
||||
<Id>
|
||||
<IBAN>
|
||||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='dbtr.iban']/value, ' ', '')" />
|
||||
</IBAN>
|
||||
</Id>
|
||||
</DbtrAcct>
|
||||
<DbtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>
|
||||
<xsl:value-of
|
||||
select="replace($exportWorkitem/item[@name='dbtr.bic']/value, ' ', '')" />
|
||||
</BIC>
|
||||
</FinInstnId>
|
||||
</DbtrAgt>
|
||||
<ChrgBr>SLEV</ChrgBr>
|
||||
<!-- generate CdtTrfTxInf for each invoice -->
|
||||
<xsl:apply-templates
|
||||
select="/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]" />
|
||||
</PmtInf>
|
||||
</CstmrCdtTrfInitn>
|
||||
</Document>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- This template builds sepa header info -->
|
||||
<xsl:template
|
||||
match="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'SEPA-Export']">
|
||||
<!-- not in use -->
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- This template builds sepa payment info for each invoice -->
|
||||
<xsl:template
|
||||
match="/data/document[starts-with(normalize-space(item[@name = '$modelversion']/value),'rechnungseingang')]">
|
||||
|
||||
<!-- round to 2 digits - geht nur mit sum funktion -->
|
||||
<xsl:variable
|
||||
name="wert2"
|
||||
select="format-number(xs:decimal(round-half-to-even(item[@name='invoice.total']/value, 2)), '0.00')" />
|
||||
|
||||
<CdtTrfTxInf
|
||||
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.003.03">
|
||||
<PmtId>
|
||||
<EndToEndId>NOTPROVIDED</EndToEndId>
|
||||
</PmtId>
|
||||
<Amt>
|
||||
<InstdAmt>
|
||||
<xsl:attribute name="Ccy"><xsl:value-of
|
||||
select="item[@name='invoice.currency']/value" /></xsl:attribute>
|
||||
<!-- round to 2 digits -->
|
||||
<xsl:value-of select="$wert2" />
|
||||
</InstdAmt>
|
||||
</Amt>
|
||||
<CdtrAgt>
|
||||
<FinInstnId>
|
||||
<BIC>
|
||||
<xsl:value-of select="replace(item[@name='cdtr.bic']/value, ' ', '')" />
|
||||
</BIC>
|
||||
</FinInstnId>
|
||||
</CdtrAgt>
|
||||
<Cdtr>
|
||||
<!-- MAX70 -->
|
||||
<Nm>
|
||||
<xsl:value-of select="substring(item[@name='cdtr.name']/value, 1, 70)" />
|
||||
</Nm>
|
||||
</Cdtr>
|
||||
<CdtrAcct>
|
||||
<Id>
|
||||
<IBAN>
|
||||
<xsl:value-of select="replace(item[@name='cdtr.iban']/value, ' ', '')" />
|
||||
</IBAN>
|
||||
</Id>
|
||||
</CdtrAcct>
|
||||
<RmtInf>
|
||||
<!-- Max140Text -->
|
||||
<Ustrd>
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(item[@name='numsequencenumber']/value) > 0">
|
||||
<!-- neues format buchungsnummer / rechn.nr -->
|
||||
<xsl:value-of
|
||||
select="item[@name='numsequencenumber']/value" /><xsl:text> / </xsl:text><xsl:value-of
|
||||
select="item[@name='invoice.number']/value" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<!-- fallback -->
|
||||
<xsl:value-of
|
||||
select="substring(item[@name='$workflowsummary']/value, 1, 140)" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</Ustrd>
|
||||
</RmtInf>
|
||||
</CdtTrfTxInf>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
Loading…
Reference in a new issue