diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/TransactionCalculator.java b/library/src/main/java/org/mustangproject/ZUGFeRD/TransactionCalculator.java index 8740e157..9c2b30f3 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/TransactionCalculator.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/TransactionCalculator.java @@ -4,7 +4,10 @@ import static java.math.BigDecimal.ZERO; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.Arrays; import java.util.HashMap; +import java.util.Objects; +import java.util.stream.Collectors; import java.util.stream.Stream; /*** @@ -91,17 +94,14 @@ public class TransactionCalculator implements IAbsoluteValueProvider { } private String getAllowanceChargeReasonForPercent(BigDecimal percent, IZUGFeRDAllowanceCharge[] charges) { - String res = " "; - if ((charges != null) && (charges.length > 0)) { - for (IZUGFeRDAllowanceCharge currentCharge : charges) { - if ((percent == null) || (currentCharge.getTaxPercent().compareTo(percent) == 0) - && currentCharge.getReason() != null) { - res += currentCharge.getReason() + " "; - } - } + if (charges == null) { + return ""; } - res = res.substring(0, res.length() - 1); - return res; + return Arrays.stream(charges) + .filter(currentCharge -> (percent == null || currentCharge.getTaxPercent().compareTo(percent) == 0)) + .map(IZUGFeRDAllowanceCharge::getReason) + .filter(Objects::nonNull) + .collect(Collectors.joining(" ")); } /*** diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDVisualizer.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDVisualizer.java index 64e14fc3..9b5c1e73 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDVisualizer.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDVisualizer.java @@ -20,42 +20,9 @@ */ package org.mustangproject.ZUGFeRD; -import java.io.BufferedOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.Result; -import javax.xml.transform.Source; -import javax.xml.transform.Templates; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.URIResolver; -import javax.xml.transform.sax.SAXResult; -import javax.xml.transform.stream.StreamResult; -import javax.xml.transform.stream.StreamSource; - -import org.apache.fop.apps.FOPException; -import org.apache.fop.apps.FOUserAgent; -import org.apache.fop.apps.Fop; -import org.apache.fop.apps.FopFactory; -import org.apache.fop.apps.FopFactoryBuilder; +import com.helger.commons.io.stream.StreamHelper; +import org.apache.commons.io.IOUtils; +import org.apache.fop.apps.*; import org.apache.fop.apps.io.ResourceResolverFactory; import org.apache.fop.configuration.Configuration; import org.apache.fop.configuration.ConfigurationException; @@ -65,12 +32,19 @@ import org.mustangproject.ClasspathResolverURIAdapter; import org.mustangproject.EStandard; import org.slf4j.Logger; import org.slf4j.LoggerFactory; - -import com.helger.commons.io.stream.StreamHelper; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.xml.sax.InputSource; -import org.xml.sax.SAXException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.*; +import javax.xml.transform.sax.SAXResult; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.Optional; public class ZUGFeRDVisualizer { @@ -113,7 +87,7 @@ public class ZUGFeRDVisualizer { * @param fis inputstream (will be consumed) * @return (facturx = cii) */ - public EStandard findOutStandardFromRootNode(InputStream fis) { + private EStandard findOutStandardFromRootNode(InputStream fis) { String zf1Signature = "CrossIndustryDocument"; String zf2Signature = "CrossIndustryInvoice"; @@ -144,106 +118,97 @@ public class ZUGFeRDVisualizer { return null; } - public String visualize(String xmlFilename, Language lang) - throws FileNotFoundException, TransformerException, IOException, SAXException, ParserConfigurationException { - - try { - if (mXsltPDFTemplate == null) { - mXsltPDFTemplate = mFactory.newTemplates( - new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/xr-pdf.xsl"))); - } - if (mXsltHTMLTemplate == null) { - mXsltHTMLTemplate = mFactory.newTemplates(new StreamSource( - CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/xrechnung-html." + lang.name().toLowerCase() + ".xsl"))); - } - if (mXsltZF1HTMLTemplate == null) { - mXsltZF1HTMLTemplate = mFactory.newTemplates(new StreamSource( - CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/ZUGFeRD_1p0_c1p0_s1p0.xslt"))); - } - } catch (TransformerConfigurationException ex) { - LOGGER.error("Failed to init XSLT templates", ex); - } - - /** - * * - * http://www.unece.org/fileadmin/DAM/cefact/xml/XML-Naming-And-Design-Rules-V2_1.pdf - * http://www.ferd-net.de/upload/Dokumente/FACTUR-X_ZUGFeRD_2p0_Teil1_Profil_EN16931_1p03.pdf - * http://countwordsfree.com/xmlviewer - */ + public String visualize(String xmlFilename, Language lang) throws IOException, TransformerException { FileInputStream fis = new FileInputStream(xmlFilename); - String fileContent = ""; - try { - fileContent = new String(Files.readAllBytes(Paths.get(xmlFilename)), StandardCharsets.UTF_8); - } catch (IOException e2) { - LOGGER.error("Failed to read file content", e2); - } + return visualize(fis, lang); + } - ByteArrayOutputStream iaos = new ByteArrayOutputStream(); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); + public String visualize(InputStream inputXml, Language lang) throws IOException, TransformerException { + initTemplates(lang); - boolean doPostProcessing = false; + String fileContent = new String(IOUtils.toByteArray(inputXml), StandardCharsets.UTF_8); + EStandard thestandard = findOutStandardFromRootNode(new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8))); + ByteArrayOutputStream htmlOutput = new ByteArrayOutputStream(); - fis = new FileInputStream(xmlFilename); // fis wont reset() so re-read from beginning - EStandard thestandard = findOutStandardFromRootNode(fis); - fis = new FileInputStream(xmlFilename); // fis wont reset() so re-read from beginning + ByteArrayInputStream xmlContentStream = new ByteArrayInputStream(fileContent.getBytes(StandardCharsets.UTF_8)); if (thestandard == EStandard.zugferd) { - applyZF1XSLT(fis, baos); + applyZF1XSLT(xmlContentStream, htmlOutput); + return htmlOutput.toString(StandardCharsets.UTF_8); } else if (thestandard == EStandard.facturx) { //zf2 or fx - applyZF2XSLT(fis, iaos); - doPostProcessing = true; + applyZF2XSLT(xmlContentStream, htmlOutput); } else if (thestandard == EStandard.ubl) { //zf2 or fx - applyUBL2XSLT(fis, iaos); - doPostProcessing = true; + applyUBL2XSLT(xmlContentStream, htmlOutput); } else if (thestandard == EStandard.ubl_creditnote) { //zf2 or fx - applyUBLCreditNote2XSLT(fis, iaos); - doPostProcessing = true; + applyUBLCreditNote2XSLT(xmlContentStream, htmlOutput); } else if (thestandard == EStandard.orderx) { //zf2 or fx - applyCIO2XSLT(fis, iaos); - doPostProcessing = true; + applyCIO2XSLT(xmlContentStream, htmlOutput); } else { throw new IllegalArgumentException("File does not look like CII or UBL"); } - if (doPostProcessing) { - // take the copy of the stream and re-write it to an InputStream - PipedInputStream in = new PipedInputStream(); - PipedOutputStream out; - try { - out = new PipedOutputStream(in); - new Thread(new Runnable() { - public void run() { - try { - // write the original OutputStream to the PipedOutputStream - // note that in order for the below method to work, you need - // to ensure that the data has finished writing to the - // ByteArrayOutputStream - iaos.writeTo(out); - } catch (IOException e) { - LOGGER.error("Failed to write to stream", e); - } finally { - // close the PipedOutputStream here because we're done writing data - // once this thread has completed its run - StreamHelper.close(out); - } - } - }).start(); - applyXSLTToHTML(in, baos); - } catch (IOException e1) { - LOGGER.error("Failed to create HTML", e1); - } - + Optional in = copyStream(htmlOutput); + ByteArrayOutputStream htmlOutStream = new ByteArrayOutputStream(); + if (in.isPresent()) { + applyXSLTToHTML(in.get(), htmlOutStream); } - return baos.toString(StandardCharsets.UTF_8); + return htmlOutStream.toString(StandardCharsets.UTF_8); + } + + /** + * TODO: jstaerk: why not copy with that simple call: new ByteArrayInputStream(byteArrayOutputStream.toByteArray()) ? + */ + private Optional copyStream(ByteArrayOutputStream byteArrayOutputStream) { + // take the copy of the stream and re-write it to an InputStream + PipedInputStream in = new PipedInputStream(); + try { + PipedOutputStream out = new PipedOutputStream(in); + new Thread(() -> { + try { + // write the original OutputStream to the PipedOutputStream + // note that in order for the below method to work, you need + // to ensure that the data has finished writing to the + // ByteArrayOutputStream + byteArrayOutputStream.writeTo(out); + } catch (IOException e) { + LOGGER.error("Failed to write to stream", e); + } finally { + // close the PipedOutputStream here because we're done writing data + // once this thread has completed its run + StreamHelper.close(out); + } + }).start(); + } catch (IOException e1) { + LOGGER.error("Failed to create HTML", e1); + return Optional.empty(); + } + return Optional.of(in); + } + + + private void initTemplates(Language lang) throws TransformerConfigurationException { + if (mXsltXRTemplate == null) { + mXsltXRTemplate = mFactory.newTemplates( + new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/cii-xr.xsl"))); + } + + if (mXsltHTMLTemplate == null) { + mXsltHTMLTemplate = mFactory.newTemplates(new StreamSource( + CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/xrechnung-html." + lang.name().toLowerCase() + ".xsl"))); + } + if (mXsltZF1HTMLTemplate == null) { + mXsltZF1HTMLTemplate = mFactory.newTemplates(new StreamSource( + CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/ZUGFeRD_1p0_c1p0_s1p0.xslt"))); + } } protected String toFOP(String xmlFilename) - throws FileNotFoundException, TransformerException { + throws IOException, TransformerException { FileInputStream fis = new FileInputStream(xmlFilename); EStandard theStandard = findOutStandardFromRootNode(fis); @@ -253,8 +218,8 @@ public class ZUGFeRDVisualizer { } protected String toFOP(InputStream is, EStandard theStandard) - throws FileNotFoundException, TransformerException { - + throws TransformerException, IOException { + try { if (mXsltPDFTemplate == null) { mXsltPDFTemplate = mFactory.newTemplates( @@ -265,7 +230,6 @@ public class ZUGFeRDVisualizer { } ByteArrayOutputStream iaos = new ByteArrayOutputStream(); - ByteArrayOutputStream baos = new ByteArrayOutputStream(); //zf2 or fx if (theStandard == EStandard.facturx) { @@ -277,33 +241,11 @@ public class ZUGFeRDVisualizer { } - PipedInputStream in = new PipedInputStream(); - PipedOutputStream out; - try { - out = new PipedOutputStream(in); - new Thread(new Runnable() { - public void run() { - try { - // write the original OutputStream to the PipedOutputStream - // note that in order for the below method to work, you need - // to ensure that the data has finished writing to the - // ByteArrayOutputStream - iaos.writeTo(out); - } catch (IOException e) { - LOGGER.error("Failed to write to stream", e); - } finally { - // close the PipedOutputStream here because we're done writing data - // once this thread has completed its run - StreamHelper.close(out); - } - } - }).start(); - applyXSLTToPDF(in, baos); - } catch (IOException e1) { - LOGGER.error("Failed to create PDF", e1); + Optional in = copyStream(iaos); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + if (in.isPresent()) { + applyXSLTToPDF(in.get(), baos); } - - return baos.toString(StandardCharsets.UTF_8); } @@ -319,7 +261,7 @@ public class ZUGFeRDVisualizer { */ try { result = this.toFOP(XMLinputFile.getAbsolutePath()); - } catch (FileNotFoundException | TransformerException e) { + } catch (TransformerException | IOException e) { LOGGER.error("Failed to apply FOP", e); } DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); @@ -373,7 +315,7 @@ public class ZUGFeRDVisualizer { } } - protected void applyZF2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream) + protected void applyZF2XSLT(final InputStream xmlFile, final OutputStream htmlOutStream) throws TransformerException { if (mXsltXRTemplate == null) { mXsltXRTemplate = mFactory.newTemplates( @@ -382,10 +324,10 @@ public class ZUGFeRDVisualizer { } Transformer transformer = mXsltXRTemplate.newTransformer(); - transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream)); + transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream)); } - protected void applyCIO2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream) + protected void applyCIO2XSLT(final InputStream xmlFile, final OutputStream htmlOutstream) throws TransformerException { if (mXsltCIOTemplate == null) { mXsltCIOTemplate = mFactory.newTemplates( @@ -393,10 +335,10 @@ public class ZUGFeRDVisualizer { } Transformer transformer = mXsltCIOTemplate.newTransformer(); - transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream)); + transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutstream)); } - protected void applyUBL2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream) + protected void applyUBL2XSLT(final InputStream xmlFile, final OutputStream htmlOutStream) throws TransformerException { if (mXsltUBLTemplate == null) { mXsltUBLTemplate = mFactory.newTemplates( @@ -404,10 +346,10 @@ public class ZUGFeRDVisualizer { } Transformer transformer = mXsltUBLTemplate.newTransformer(); - transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream)); + transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream)); } - protected void applyUBLCreditNote2XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream) + protected void applyUBLCreditNote2XSLT(final InputStream xmlFile, final OutputStream htmlOutStream) throws TransformerException { if (mXsltUBLTemplate == null) { mXsltUBLTemplate = mFactory.newTemplates( @@ -415,28 +357,30 @@ public class ZUGFeRDVisualizer { } Transformer transformer = mXsltUBLTemplate.newTransformer(); - transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream)); + transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream)); } - protected void applyZF1XSLT(final InputStream xmlFile, final OutputStream HTMLOutstream) + protected void applyZF1XSLT(final InputStream xmlFile, final OutputStream htmlOutStream) throws TransformerException { Transformer transformer = mXsltZF1HTMLTemplate.newTransformer(); - transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream)); + transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream)); } - protected void applyXSLTToHTML(final InputStream xmlFile, final OutputStream HTMLOutstream) - throws TransformerException { + protected void applyXSLTToHTML(final InputStream xmlFile, final OutputStream htmlOutStream) + throws TransformerException, IOException { Transformer transformer = mXsltHTMLTemplate.newTransformer(); - transformer.transform(new StreamSource(xmlFile), new StreamResult(HTMLOutstream)); + transformer.transform(new StreamSource(xmlFile), new StreamResult(htmlOutStream)); + xmlFile.close(); } protected void applyXSLTToPDF(final InputStream xmlFile, final OutputStream PDFOutstream) - throws TransformerException { + throws TransformerException, IOException { Transformer transformer = mXsltPDFTemplate.newTransformer(); transformer.transform(new StreamSource(xmlFile), new StreamResult(PDFOutstream)); + xmlFile.close(); } private static class ClasspathResourceURIResolver implements URIResolver { @@ -445,7 +389,7 @@ public class ZUGFeRDVisualizer { } @Override - public Source resolve(String href, String base) throws TransformerException { + public Source resolve(String href, String base) { return new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/" + href)); } } diff --git a/library/src/main/resources/stylesheets/cii-xr.xsl b/library/src/main/resources/stylesheets/cii-xr.xsl index 421fe673..f741c903 100644 --- a/library/src/main/resources/stylesheets/cii-xr.xsl +++ b/library/src/main/resources/stylesheets/cii-xr.xsl @@ -1,2597 +1,2650 @@ - - - - - - Author: - KoSIT Bremen (kosit@finanzen.bremen.de) - - Fassung vom: 2020-06-30+02:00 - modifiziert durch Dr. Jan Thiele am: 2021-02-11+01:00 - Überführt eine zur EN 16931 konforme elektronische Rechnung in der konkreten Syntax UNCEFACT.CII.D16B - in eine Instanz gemäß des Schemas für den Namensraum - urn:ce.eu:en16931:2017:xoev-de:kosit:standard:xrechnung-1. - - Das Skript setzt voraus, dass das zu verarbeitende Dokument valide bzgl. des XML Schemas und der - Schematron-Regeln der Quelle ist. Für nicht valide Dokumente ist das Ergebnis nicht definiert. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #SKONTO# - - TAGE - WOCHEN - - =#PROZENT=# - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ILLEGAL DATE FORMAT: <para>Mit diesem Datentyp wird ein kalendarisches Datum - abgebildet, wie es in der ISO 8601 Spezifikation <quote>Calendar date complete representation</quote> - beschrieben ist (siehe ISO 8601:2004, Abschnitt 5.2.1.1). Das Datum beinhaltet keine Zeitangabe. Das - konkret zu verwendende Format ist abhängig von der genutzten Syntax.</para> - <para>Der Datentyp basiert auf dem Typ <quote>Date Time. Type</quote>, wie in ISO - 15000-5:2014 Anhang B definiert.</para> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Liefert einen XPath-Pfad, welches $n eindeutig identifiziert. - - - - - - - - - - - Liefert einen XPath-Pfad, welches $n eindeutig identifiziert. - - - - - / - - - [ - - ] - - - - /@ - - - + + + + + + Author: + KoSIT Bremen (kosit@finanzen.bremen.de) + + Fassung vom: 2020-06-30+02:00 + modifiziert durch Dr. Jan Thiele am: 2021-02-11+01:00 + Überführt eine zur EN 16931 konforme elektronische Rechnung in der konkreten Syntax UNCEFACT.CII.D16B + in eine Instanz gemäß des Schemas für den Namensraum + urn:ce.eu:en16931:2017:xoev-de:kosit:standard:xrechnung-1. + + Das Skript setzt voraus, dass das zu verarbeitende Dokument valide bzgl. des XML Schemas und der + Schematron-Regeln der Quelle ist. Für nicht valide Dokumente ist das Ergebnis nicht definiert. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ; + + + + + + + + + + + + + + + + + + + ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #SKONTO# + + TAGE + WOCHEN + + =#PROZENT=# + + + + + + + ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ILLEGAL DATE FORMAT: <para>Mit diesem Datentyp wird ein kalendarisches Datum + abgebildet, wie es in der ISO 8601 Spezifikation <quote>Calendar date complete representation</quote> + beschrieben ist (siehe ISO 8601:2004, Abschnitt 5.2.1.1). Das Datum beinhaltet keine Zeitangabe. Das + konkret zu verwendende Format ist abhängig von der genutzten Syntax.</para> + <para>Der Datentyp basiert auf dem Typ <quote>Date Time. Type</quote>, wie in ISO + 15000-5:2014 Anhang B definiert.</para> + + + + + + + + + + + + ILLEGAL DATE FORMAT: <para>Mit diesem Datentyp wird ein kalendarisches Datum + abgebildet, wie es in der ISO 8601 Spezifikation <quote>Calendar date complete representation</quote> + beschrieben ist (siehe ISO 8601:2004, Abschnitt 5.2.1.1). Das Datum beinhaltet keine Zeitangabe. Das + konkret zu verwendende Format ist abhängig von der genutzten Syntax.</para> + <para>Der Datentyp basiert auf dem Typ <quote>Date Time. Type</quote>, wie in ISO + 15000-5:2014 Anhang B definiert.</para> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Liefert einen XPath-Pfad, welches $n eindeutig identifiziert. + + + + + + + + + + + Liefert einen XPath-Pfad, welches $n eindeutig identifiziert. + + + + + / + + + [ + + ] + + + + /@ + + + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.de.xsl b/library/src/main/resources/stylesheets/xrechnung-html.de.xsl index 55da04b4..e2a2e930 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.de.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.de.xsl @@ -1,227 +1,229 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.en.xsl b/library/src/main/resources/stylesheets/xrechnung-html.en.xsl index dd251fb7..c989a430 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.en.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.en.xsl @@ -1,227 +1,229 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl b/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl index ccbafdd0..5be83bab 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl @@ -1,227 +1,229 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl index 21b2883d..92689837 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl @@ -1144,17 +1144,29 @@ function downloadData (element_id) { -
- -
+ + +
+ +
+
+
-
- -
- -
- -
+ + +
+ +
+
+
+ + + +
+ +
+
+
@@ -2182,11 +2194,24 @@ function downloadData (element_id) {
:
-
+
+ + +
:
-
+
+ + +
+
+
+
:
+
+ + +
:
diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java index 3ab73e7d..88c4fccf 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java @@ -22,10 +22,9 @@ package org.mustangproject.ZUGFeRD; import org.junit.FixMethodOrder; import org.junit.runners.MethodSorters; +import org.mustangproject.ZUGFeRD.ZUGFeRDVisualizer.Language; import org.mustangproject.util.ByteArraySearcher; -import org.xml.sax.SAXException; -import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import java.io.File; import java.io.IOException; @@ -40,179 +39,34 @@ public class VisualizationTest extends ResourceCase { final String TARGET_PDF_UBL = "./target/testout-Visualization-cii.pdf"; public void testCIIVisualizationBasic() { - - // the writing part - String sourceFilename = "factur-x.xml"; - File CIIinputFile = getResourceAsFile(sourceFilename); - - String expected = null; - String result = null; - try { - ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer(); - /* remove file endings so that tests can also pass after checking - out from git with arbitrary options (which may include CSRF changes) - */ - result = zvi.visualize(CIIinputFile.getAbsolutePath(), ZUGFeRDVisualizer.Language.FR); - Files.write(Paths.get("./target/testout-factur-x-vis.fr.html"), result.getBytes(StandardCharsets.UTF_8)); - result = result - .replace("\r", "") - .replace("\n", "") - .replace("\t", "") - .replace(" ", ""); - - File expectedResult = getResourceAsFile("factur-x-vis.fr.html"); - expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8) - .replace("\r", "") - .replace("\n", "") - .replace("\t", "") - .replace(" ", ""); - // remove linebreaks as well... - - } catch (UnsupportedOperationException e) { - fail("UnsupportedOperationException should not happen: " + e.getMessage()); - } catch (IllegalArgumentException e) { - fail("IllegalArgumentException should not happen: " + e.getMessage()); - } catch (TransformerException e) { - fail("TransformerException should not happen: " + e.getMessage()); - } catch (IOException e) { - fail("IOException should not happen: " + e.getMessage()); - } catch (ParserConfigurationException e) { - fail("ParserConfigurationException should not happen: " + e.getMessage()); - } catch (SAXException e) { - fail("SAXException should not happen: " + e.getMessage()); - } - - - assertNotNull(result); - // Reading ZUGFeRD - assertEquals(expected, result); + this.runZUGFeRDVisualization("factur-x.xml", "factur-x-vis.fr.html", Language.FR); } public void testCIIVisualizationExtended() { - - // the writing part - String sourceFilename = "factur-x-extended.xml"; - File CIIinputFile = getResourceAsFile(sourceFilename); - - String expected = null; - String result = null; - try { - ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer(); - /* remove file endings so that tests can also pass after checking - out from git with arbitrary options (which may include CSRF changes) - */ - result = zvi.visualize(CIIinputFile.getAbsolutePath(), ZUGFeRDVisualizer.Language.DE); - Files.write(Paths.get("./target/testout-factur-x-vis-extended.de.html"), result.getBytes(StandardCharsets.UTF_8)); - result = result - .replace("\r", "") - .replace("\n", "") - .replace("\t", "") - .replace(" ", ""); - - File expectedResult = getResourceAsFile("factur-x-vis-extended.de.html"); - expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8) - .replace("\r", "") - .replace("\n", "") - .replace("\t", "") - .replace(" ", ""); - // remove linebreaks as well... - - } catch (UnsupportedOperationException e) { - fail("UnsupportedOperationException should not happen: " + e.getMessage()); - } catch (IllegalArgumentException e) { - fail("IllegalArgumentException should not happen: " + e.getMessage()); - } catch (TransformerException e) { - fail("TransformerException should not happen: " + e.getMessage()); - } catch (IOException e) { - fail("IOException should not happen: " + e.getMessage()); - } catch (ParserConfigurationException e) { - fail("ParserConfigurationException should not happen: " + e.getMessage()); - } catch (SAXException e) { - fail("SAXException should not happen: " + e.getMessage()); - } - - - assertNotNull(result); - // Reading ZUGFeRD - assertEquals(expected, result); + this.runZUGFeRDVisualization("factur-x-extended.xml", "factur-x-vis-extended.de.html", Language.DE); } public void testUBLCreditNoteVisualizationBasic() { - - // the writing part - File UBLinputFile = getResourceAsFile("ubl-creditnote.xml"); - - String expected = null; - String result = null; - try { - ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer(); - /* remove file endings so that tests can also pass after checking - out from git with arbitrary options (which may include CSRF changes) - */ - result = zvi.visualize(UBLinputFile.getAbsolutePath(), ZUGFeRDVisualizer.Language.EN); - Files.write(Paths.get("./target/testout-factur-x-vis-ubl-creditnote.en.html"), result.getBytes(StandardCharsets.UTF_8)); - result = result - .replace("\r", "") - .replace("\n", "") - .replace("\t", "") - .replace(" ", ""); - - File expectedResult = getResourceAsFile("factur-x-vis-ubl-creditnote.en.html"); - expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8) - .replace("\r", "") - .replace("\n", "") - .replace("\t", "") - .replace(" ", ""); - // remove linebreaks as well... - - } catch (UnsupportedOperationException e) { - fail("UnsupportedOperationException should not happen: " + e.getMessage()); - } catch (IllegalArgumentException e) { - fail("IllegalArgumentException should not happen: " + e.getMessage()); - } catch (TransformerException e) { - fail("TransformerException should not happen: " + e.getMessage()); - } catch (IOException e) { - fail("IOException should not happen: " + e.getMessage()); - } catch (ParserConfigurationException e) { - fail("ParserConfigurationException should not happen: " + e.getMessage()); - } catch (SAXException e) { - fail("SAXException should not happen: " + e.getMessage()); - } - - - assertNotNull(result); - // Reading ZUGFeRD - assertEquals(expected, result); + this.runZUGFeRDVisualization("ubl-creditnote.xml", "factur-x-vis-ubl-creditnote.en.html", Language.EN); } - public void testUBLVisualizationBasic() { + this.runZUGFeRDVisualization("ubl/01.01a-INVOICE.ubl.xml", "factur-x-vis-ubl.en.html", Language.EN); + } - // the writing part - File UBLinputFile = getResourceAsFile("ubl/01.01a-INVOICE.ubl.xml"); + private void runZUGFeRDVisualization(String inputFilename, String resultFileName, Language lang) { + File CIIinputFile = getResourceAsFile(inputFilename); String expected = null; String result = null; try { ZUGFeRDVisualizer zvi = new ZUGFeRDVisualizer(); - /* remove file endings so that tests can also pass after checking - out from git with arbitrary options (which may include CSRF changes) - */ - result = zvi.visualize(UBLinputFile.getAbsolutePath(), ZUGFeRDVisualizer.Language.EN); - Files.write(Paths.get("./target/testout-factur-x-vis-ubl.en.html"), result.getBytes(StandardCharsets.UTF_8)); - result = result - .replace("\r", "") - .replace("\n", "") - .replace("\t", "") - .replace(" ", ""); + result = zvi.visualize(CIIinputFile.getAbsolutePath(), lang); + Files.write(Paths.get("./target/testout-" + resultFileName), result.getBytes(StandardCharsets.UTF_8)); - File expectedResult = getResourceAsFile("factur-x-vis-ubl.en.html"); + File expectedResult = getResourceAsFile(resultFileName); expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8) - .replace("\r", "") - .replace("\n", "") - .replace("\t", "") - .replace(" ", ""); - // remove linebreaks as well... + ; } catch (UnsupportedOperationException e) { fail("UnsupportedOperationException should not happen: " + e.getMessage()); @@ -222,16 +76,20 @@ public class VisualizationTest extends ResourceCase { fail("TransformerException should not happen: " + e.getMessage()); } catch (IOException e) { fail("IOException should not happen: " + e.getMessage()); - } catch (ParserConfigurationException e) { - fail("ParserConfigurationException should not happen: " + e.getMessage()); - } catch (SAXException e) { - fail("SAXException should not happen: " + e.getMessage()); } assertNotNull(result); - // Reading ZUGFeRD - assertEquals(expected, result); + /* remove file endings so that tests can also pass after checking + out from git with arbitrary options (which may include CSRF changes) + */ + assertEquals(expected.replace("\r", "") + .replace("\n", "") + .replace("\t", "") + .replace(" ", ""), result.replace("\r", "") + .replace("\n", "") + .replace("\t", "") + .replace(" ", "")); } public void testPDFVisualizationCII() { diff --git a/library/src/test/resources/factur-x-extended.xml b/library/src/test/resources/factur-x-extended.xml index cfb77358..a7c5fb27 100644 --- a/library/src/test/resources/factur-x-extended.xml +++ b/library/src/test/resources/factur-x-extended.xml @@ -1,427 +1,430 @@ - - - - - - - - - - true - - - urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended - - - - KR87654321012 - KOSTENRECHNUNG - 380 - - 20241115 - - - ST3 - Es bestehen Rabatt- oder Bonusvereinbarungen. - AAK - - - EEV - Der Verkäufer bleibt Eigentümer der Waren bis zur vollständigen Erfüllung der Kaufpreisforderung. - AAJ - - - MUSTERLIEFERANT GMBH -BAHNHOFSTRASSE 99 -99199 MUSTERHAUSEN -Geschäftsführung: -Max Mustermann -USt-IdNr: DE123456789 -Telefon: +49 932 431 0 -www.musterlieferant.de -HRB Nr. 372876 -Amtsgericht Musterstadt -GLN 4304171000002 - - REG - - - - - - 1 - - - 4123456000014 - WA997 - Wirkarbeit HT - - Zählpunkt - DE0001346484600000000000000100038 - - - - - 0.0520 - - - 0.0520 - - - - 1000.0000 - - - - VAT - S - 19.00 - - - 52.00 - - - - - - 2 - - - 4123456000021 - ÖST250 - Ökosteuer Lieferant - - - - 0.0205 - - - 0.0205 - - - - 1000.0000 - - - - VAT - S - 19.00 - - - 20.50 - - - - - - 3 - - - 4260331811362 - Kommissionierer 1250032 D. Muster - Besteller: Hr. Mayer, Personalnr. 4488 - - - - 15.0000 - - - false - - 4.50 - Artikelrabatt 1 - - - - 10.5000 - - - - 27.5000 - - - - VAT - S - 19.00 - - - 288.75 - - - - - - 4 - - - 2001015001325 - FB05 - FALTENBEUTEL 16x6x28 CM - - - - 0.0105 - - - 0.0105 - - - - 3500.0000 - - - - VAT - S - 19.00 - - - 36.75 - - - - - - 5 - - - 4123456000038 - KOP05 - Kopierpapier A4 - Zählerstand von-bis: 543210 - 544420 - - Zähler-Nr. - MG-X79318 - - - - - 0.0100 - - - 0.0100 - - - - 1210.0000 - - - - VAT - S - 19.00 - - - 12.10 - - - - - - 549910 - 4333741000005 - MUSTERLIEFERANT GMBH - - - +49 932 431 500 - - - max.mustermann@musterlieferant.de - - - - 99199 - BAHNHOFSTRASSE 99 - MUSTERHAUSEN - DE - - - 201/113/40209 - - - - 339420 - 4304171000002 - MUSTER-KUNDE GMBH - - 40235 - KUNDENWEG 88 - DUESSELDORF - DE - - - - A777123 - 130 - - - - - 4304171088093 - MUSTER-MARKT - - 7322 - - - 31157 - HAUPTSTRASSE 44 - SARSTEDT - DE - - - - - 20241030 - - - - L87654321012 - - - - EUR - - 339420 - 4304171000002 - MUSTER-KUNDE GMBH - - 40235 - KUNDENWEG 88 - DUESSELDORF - DE - - - - 76.67 - VAT - 403.55 - 410.10 - -6.55 - S - 19.00 - - - - false - - 410.10 - 21.55 - Sonderrabatt - - VAT - S - 19.00 - - - - Transportkosten: Frachbetrag - 15.00 - - VAT - S - 19.00 - - - - Skontovereinbarung: 2% bei Zahlung innerhalb 10 Tagen nach Rechnungsdatum - - 10 - 2.00 - - - - 410.10 - 15.00 - 21.55 - 403.55 - 76.67 - 480.22 - 0.00 - 480.22 - - - - + + + + + + + + + + true + + + urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended + + + + KR87654321012 + KOSTENRECHNUNG + 380 + + 20241115 + + + ST3 + Es bestehen Rabatt- oder Bonusvereinbarungen. + AAK + + + EEV + Der Verkäufer bleibt Eigentümer der Waren bis zur vollständigen Erfüllung der Kaufpreisforderung. + AAJ + + + MUSTERLIEFERANT GMBH +BAHNHOFSTRASSE 99 +99199 MUSTERHAUSEN +Geschäftsführung: +Max Mustermann +USt-IdNr: DE123456789 +Telefon: +49 932 431 0 +www.musterlieferant.de +HRB Nr. 372876 +Amtsgericht Musterstadt +GLN 4304171000002 + + REG + + + + + + 1 + + + 4123456000014 + WA997 + Wirkarbeit HT + + Zählpunkt + DE0001346484600000000000000100038 + + + + + 0.0520 + + + 0.0520 + + + + 1000.0000 + + + + VAT + S + 19.00 + + + 52.00 + + + + + + 2 + + + 4123456000021 + ÖST250 + Ökosteuer Lieferant + + + + 0.0205 + + + 0.0205 + + + + 1000.0000 + + + + VAT + S + 19.00 + + + 20.50 + + + + + + 3 + + + 4260331811362 + Kommissionierer 1250032 D. Muster + Besteller: Hr. Mayer, Personalnr. 4488 + + + + 15.0000 + + + false + + 4.50 + Artikelrabatt 1 + + + + 10.5000 + + + + 27.5000 + + + + VAT + S + 19.00 + + + 288.75 + + + + + + 4 + + + 2001015001325 + FB05 + FALTENBEUTEL 16x6x28 CM + + + + 0.0105 + + + 0.0105 + + + + 3500.0000 + + + + VAT + S + 19.00 + + + 36.75 + + + + + + 5 + + + 4123456000038 + KOP05 + Kopierpapier A4 + Zählerstand von-bis: 543210 - 544420 + + Zähler-Nr. + MG-X79318 + + + + + 0.0100 + + + 0.0100 + + + + 1210.0000 + + + + VAT + S + 19.00 + + + 12.10 + + + + + + 549910 + 4333741000005 + MUSTERLIEFERANT GMBH + + + +49 932 431 500 + + + max.mustermann@musterlieferant.de + + + + 99199 + BAHNHOFSTRASSE 99 + MUSTERHAUSEN + DE + + + 201/113/40209 + + + + 339420 + 4304171000002 + MUSTER-KUNDE GMBH + + 40235 + KUNDENWEG 88 + DUESSELDORF + DE + + + + A777123 + 130 + + + + + 4304171088093 + MUSTER-MARKT + + 7322 + + + 31157 + HAUPTSTRASSE 44 + SARSTEDT + DE + + + + + 20241030 + + + + L87654321012 + + 20241031 + + + + + EUR + + 339420 + 4304171000002 + MUSTER-KUNDE GMBH + + 40235 + KUNDENWEG 88 + DUESSELDORF + DE + + + + 76.67 + VAT + 403.55 + 410.10 + -6.55 + S + 19.00 + + + + false + + 410.10 + 21.55 + Sonderrabatt + + VAT + S + 19.00 + + + + Transportkosten: Frachbetrag + 15.00 + + VAT + S + 19.00 + + + + Skontovereinbarung: 2% bei Zahlung innerhalb 10 Tagen nach Rechnungsdatum + + 10 + 2.00 + + + + 410.10 + 15.00 + 21.55 + 403.55 + 76.67 + 480.22 + 0.00 + 480.22 + + + + diff --git a/library/src/test/resources/factur-x-vis-extended.de.html b/library/src/test/resources/factur-x-vis-extended.de.html index bec60374..ed5a147d 100644 --- a/library/src/test/resources/factur-x-vis-extended.de.html +++ b/library/src/test/resources/factur-x-vis-extended.de.html @@ -1085,7 +1085,6 @@
-
@@ -2248,6 +2247,10 @@
Kennung der Versandanzeige:
+
+
Kennung des Lieferscheins:
+
L87654321012 vom 31.10.2024
+
Prozesskennung:
diff --git a/library/src/test/resources/factur-x-vis-ubl-creditnote.en.html b/library/src/test/resources/factur-x-vis-ubl-creditnote.en.html index 9e849b32..4c63e9c9 100644 --- a/library/src/test/resources/factur-x-vis-ubl-creditnote.en.html +++ b/library/src/test/resources/factur-x-vis-ubl-creditnote.en.html @@ -1359,7 +1359,6 @@
-
@@ -1556,7 +1555,7 @@
Description:
Processor: Intel Core 2 Duo SU9400 LV (1.4GHz). RAM: - 3MB. Screen 1440x900
+ 3MB. Screen 1440x900
Part number:
@@ -2355,6 +2354,10 @@
Dispatch note ID:
+
+
Delivery note ID:
+
+
Process ID:
diff --git a/library/src/test/resources/factur-x-vis-ubl.en.html b/library/src/test/resources/factur-x-vis-ubl.en.html index 9dd2506a..4a394f1c 100644 --- a/library/src/test/resources/factur-x-vis-ubl.en.html +++ b/library/src/test/resources/factur-x-vis-ubl.en.html @@ -1219,9 +1219,6 @@
-
-
-
@@ -1755,6 +1752,10 @@
Dispatch note ID:
+
+
Delivery note ID:
+
+
Process ID:
diff --git a/library/src/test/resources/factur-x-vis.fr.html b/library/src/test/resources/factur-x-vis.fr.html index 0b91ac44..e22b12ef 100644 --- a/library/src/test/resources/factur-x-vis.fr.html +++ b/library/src/test/resources/factur-x-vis.fr.html @@ -1250,9 +1250,6 @@
-
-
-
@@ -1927,6 +1924,10 @@
Identifiant du bordereau d'expédition:
+
+
Identifiant du bon de livraison:
+
+
Identifiant processus: