From 394e923a70c82817ba370bb78972a5dd202ef1a0 Mon Sep 17 00:00:00 2001 From: Ralph Soika Date: Fri, 20 Nov 2020 15:46:00 +0100 Subject: [PATCH] sepa update --- .../pages/workitems/forms/sepa_export.xhtml | 24 +++++++++---------- reports/sepa/sepa-2.0.1.imixs-report | 2 +- reports/sepa/{sepa.xsl => sepa-2.0.1.xsl} | 22 ++++++++--------- 3 files changed, 24 insertions(+), 24 deletions(-) rename reports/sepa/{sepa.xsl => sepa-2.0.1.xsl} (84%) diff --git a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/sepa_export.xhtml b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/sepa_export.xhtml index 6699573..2bf4d90 100644 --- a/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/sepa_export.xhtml +++ b/office-alexander-logistics-app/src/main/webapp/pages/workitems/forms/sepa_export.xhtml @@ -11,7 +11,7 @@
IBAN
- +
@@ -19,7 +19,7 @@
BIC
- +
@@ -39,24 +39,24 @@ IBAN BIC - + - #{invoice.item['_kreditor']} - #{invoice.item['_invoicenumber']} - + #{invoice.item['cdtr.name']} + #{invoice.item['invoice.number']} + + value="#{invoice.item['invoice.total']}"> - #{invoice.item['_currency']} - #{invoice.item ['_cdtr_iban']} - #{invoice.item['_cdtr_bic']} + #{invoice.item['invoice.currency']} + #{invoice.item ['cdtr.iban']} + #{invoice.item['cdtr.bic']} @@ -65,10 +65,10 @@ Summary + value="#{sepaController.calculateSum(workitem.itemList['$workitemref'], 'invoice.total')}"> - #{invoice.item['_currency']} + #{invoice.item['invoice.currency']} diff --git a/reports/sepa/sepa-2.0.1.imixs-report b/reports/sepa/sepa-2.0.1.imixs-report index 1e7ece5..9ee7c17 100644 --- a/reports/sepa/sepa-2.0.1.imixs-report +++ b/reports/sepa/sepa-2.0.1.imixs-report @@ -1 +1 @@ -$uniqueid$workflowgroup$processid_subject_invoicenumber_invoicedate_amount_brutto_currency_cdtr_name_cdtr_iban_cdtr_bic_dbtr_name_dbtr_iban_dbtr_bic_invoicepurposeUTF-8SEPA export executed by the SepaScheduler. See the XSL definition for details. sepatype:"sepa" AND $taskid:210 <?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[normalize-space(item[@name = '$workflowgroup']/value) = 'SEPA-Request']/item[@name='$uniqueid']/value)" /> <!-- compute total amount --> <xsl:variable name="totalsum" select="xs:decimal(sum(/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'SEPA-Request']/item[@name='_amount_brutto']/value))" /> <!-- round to 2 digits --> <xsl:variable name="total" select="xs:decimal(round-half-to-even($totalsum, 2))" /> <!-- 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>KRIEGER GmbH</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="$exportWorkitem/item[@name='_dbtr_bic']/value" /> </BIC> </FinInstnId> </DbtrAgt> <ChrgBr>SLEV</ChrgBr> <!-- generate CdtTrfTxInf for each invoice --> <xsl:apply-templates select="/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'SEPA-Request']" /> </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[normalize-space(item[@name = '$workflowgroup']/value) = 'SEPA-Request']"> <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='_currency']/value" /></xsl:attribute> <xsl:value-of select="item[@name='_amount_brutto']/value" /> </InstdAmt> </Amt> <CdtrAgt> <FinInstnId> <BIC> <xsl:value-of select="item[@name='_cdtr_bic']/value" /> </BIC> </FinInstnId> </CdtrAgt> <Cdtr> <Nm> <xsl:value-of select="item[@name='_cdtr_name']/value" /> </Nm> </Cdtr> <CdtrAcct> <Id> <IBAN> <xsl:value-of select="replace(item[@name='_cdtr_iban']/value, ' ', '')" /> </IBAN> </Id> </CdtrAcct> <RmtInf> <Ustrd> <xsl:value-of select="item[@name='_invoicepurpose']/value" /> </Ustrd> </RmtInf> </CdtTrfTxInf> </xsl:template></xsl:stylesheet>/office-krieger/src/reports/SEPA/sepa.xsl \ No newline at end of file +$uniqueid$workflowgroup$processid$workflowsummaryinvoice.numberinvoice.dateinvoice.totalinvoice.currencycdtr.namecdtr.ibancdtr.bicdbtr.namedbtr.ibandbtr.bicUTF-8SEPA export executed by the SepaScheduler. See the XSL definition for details. sepatype:"sepa" AND $taskid:210 <?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[normalize-space(item[@name = '$workflowgroup']/value) = 'Rechnungseingang']/item[@name='$uniqueid']/value)" /> <!-- compute total amount --> <xsl:variable name="totalsum" select="xs:decimal(sum(/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'Rechnungseingang']/item[@name='invoice.total']/value))" /> <!-- round to 2 digits --> <xsl:variable name="total" select="xs:decimal(round-half-to-even($totalsum, 2))" /> <!-- 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> <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> <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="$exportWorkitem/item[@name='dbtr.bic']/value" /> </BIC> </FinInstnId> </DbtrAgt> <ChrgBr>SLEV</ChrgBr> <!-- generate CdtTrfTxInf for each invoice --> <xsl:apply-templates select="/data/document[normalize-space(item[@name = '$workflowgroup']/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[normalize-space(item[@name = '$workflowgroup']/value) = 'Rechnungseingang']"> <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> <xsl:value-of select="item[@name='invoice.total']/value" /> </InstdAmt> </Amt> <CdtrAgt> <FinInstnId> <BIC> <xsl:value-of select="item[@name='cdtr.bic']/value" /> </BIC> </FinInstnId> </CdtrAgt> <Cdtr> <Nm> <xsl:value-of select="item[@name='cdtr.name']/value" /> </Nm> </Cdtr> <CdtrAcct> <Id> <IBAN> <xsl:value-of select="replace(item[@name='cdtr.iban']/value, ' ', '')" /> </IBAN> </Id> </CdtrAcct> <RmtInf> <Ustrd> <xsl:value-of select="item[@name='$workflowsummary']/value" /> </Ustrd> </RmtInf> </CdtTrfTxInf> </xsl:template></xsl:stylesheet>/imixs-adapters-sepa/src/reports/sepa-2.0.1.xsl \ No newline at end of file diff --git a/reports/sepa/sepa.xsl b/reports/sepa/sepa-2.0.1.xsl similarity index 84% rename from reports/sepa/sepa.xsl rename to reports/sepa/sepa-2.0.1.xsl index 06e30c9..a405ea1 100644 --- a/reports/sepa/sepa.xsl +++ b/reports/sepa/sepa-2.0.1.xsl @@ -23,7 +23,7 @@ select="count(/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'Rechnungseingang']/item[@name='$uniqueid']/value)" /> + select="xs:decimal(sum(/data/document[normalize-space(item[@name = '$workflowgroup']/value) = 'Rechnungseingang']/item[@name='invoice.total']/value))" /> @@ -48,7 +48,7 @@ + select="$exportWorkitem/item[@name='dbtr.name']/value" /> @@ -75,14 +75,14 @@ + select="$exportWorkitem/item[@name='dbtr.name']/value" /> + select="replace($exportWorkitem/item[@name='dbtr.iban']/value, ' ', '')" /> @@ -90,7 +90,7 @@ + select="$exportWorkitem/item[@name='dbtr.bic']/value" /> @@ -133,33 +133,33 @@ + select="item[@name='invoice.currency']/value" /> + select="item[@name='invoice.total']/value" /> - + - + - + - +