From f211f8ad1cc782e7f9db0fc98dbf36d2ee70cbac Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Fri, 6 Sep 2024 10:06:59 +0200 Subject: [PATCH] update version, update pl sepa xslt --- .../sepa/TestSEPATransform.java | 2 +- pom.xml | 2 +- reports/sepa/sepa-2.0.10-pl.imixs-report | 196 ++++++++++++++++++ reports/sepa/sepa-2.0.10-pl.xsl | 196 ++++++++++++++++++ workflow/dwc/mahnlauf-en-1.0.0.bpmn | 2 +- 5 files changed, 395 insertions(+), 3 deletions(-) create mode 100644 reports/sepa/sepa-2.0.10-pl.imixs-report create mode 100644 reports/sepa/sepa-2.0.10-pl.xsl diff --git a/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/sepa/TestSEPATransform.java b/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/sepa/TestSEPATransform.java index 430be8c..a23a758 100644 --- a/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/sepa/TestSEPATransform.java +++ b/office-alexander-logistics-app/src/test/java/com/alexanderlogistics/sepa/TestSEPATransform.java @@ -54,7 +54,7 @@ public class TestSEPATransform { @Test public void testBankPolski() throws IOException { String MODEL_PATH_XML = "sepa/beispiel-daten.xml"; - String MODEL_PATH_XSL = "sepa/sepa-2.0.9-pl.xsl"; + String MODEL_PATH_XSL = "sepa/sepa-2.0.10-pl.xsl"; try { XSLTester.transform(MODEL_PATH_XML, MODEL_PATH_XSL, "../reports/sepa/result_sepa02.xml"); } catch (Exception e) { diff --git a/pom.xml b/pom.xml index f0aea13..48b4077 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ 10.0.0 - 5.0.2-SNAPSHOT + 5.0.2 6.0.8-SNAPSHOT 5.0.0 3.0.2-SNAPSHOT diff --git a/reports/sepa/sepa-2.0.10-pl.imixs-report b/reports/sepa/sepa-2.0.10-pl.imixs-report new file mode 100644 index 0000000..04e7421 --- /dev/null +++ b/reports/sepa/sepa-2.0.10-pl.imixs-report @@ -0,0 +1,196 @@ +2024-01-11T14:31:52.923+01:00true2024-09-06T10:05:18.320+02:001a36c52d3-25bc-4c43-8c41-e90e2fd47432-1725609918326a36c52d3-25bc-4c43-8c41-e90e2fd474329$uniqueid$modelversion$workflowgroup$taskid$workflowsummaryinvoice.numberinvoice.dateinvoice.totalinvoice.currencycdtr.namecdtr.ibancdtr.bicdbtr.namedbtr.ibandbtr.bicpayment.typenumsequencenumberUTF-8SEPA export executed by the SepaScheduler. See the XSL definition for details. sepatype:"workitem" AND $taskid:5500 ReportEntity<?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)" /> --> + <!-- entfernen der non ascii zeichen + <xsl:value-of + select="substring(replace(item[@name='cdtr.name']/value, '\P{IsBasicLatin}', ''), 1, 70)" /> + --> + + <xsl:value-of + select="substring(translate( + normalize-space(item[@name='cdtr.name']/value), + translate(item[@name='cdtr.name']/value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 /-?:().,''+''{}.', ''),''), 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='invoice.number']/value) > 0"> + <xsl:value-of + select="substring(translate( + normalize-space(item[@name='invoice.number']/value), + translate(item[@name='invoice.number']/value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 /-?:().,''+''{}.', ''),''), 1, 140)" /> + </xsl:when> + <xsl:otherwise> + <!-- fallback --> + <xsl:value-of + select="substring(item[@name='sequencenumber']/value, 1, 140)" /> + </xsl:otherwise> + </xsl:choose> + </Ustrd> + </RmtInf> + </CdtTrfTxInf> + + </xsl:template> + +</xsl:stylesheet>/office-alexander-logistics/reports/sepa/sepa-2.0.5.xsl \ No newline at end of file diff --git a/reports/sepa/sepa-2.0.10-pl.xsl b/reports/sepa/sepa-2.0.10-pl.xsl new file mode 100644 index 0000000..3f518d5 --- /dev/null +++ b/reports/sepa/sepa-2.0.10-pl.xsl @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -1 + + TRF + + + + + + + + + + SEPA + + + + + + + + + + + + + + + + + + + + + + + + + + SHAR + + + + + + + + + + + + + + + + + + + + + + + NOTPROVIDED + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/workflow/dwc/mahnlauf-en-1.0.0.bpmn b/workflow/dwc/mahnlauf-en-1.0.0.bpmn index 8d0f09b..97a6ef8 100644 --- a/workflow/dwc/mahnlauf-en-1.0.0.bpmn +++ b/workflow/dwc/mahnlauf-en-1.0.0.bpmn @@ -449,7 +449,7 @@ Debitor: dbtr.name (dbtr.number) Invoice No. Date -Expiry Date +Due Date Invoice Amount Balance