From e2b67b012b7da1a488e7661864c997fcd0c3c71a Mon Sep 17 00:00:00 2001 From: Tim Karliczek Date: Tue, 3 Dec 2024 13:19:55 +0100 Subject: [PATCH 01/36] add tax category code for free export ("G") and add it to "with exemption reason" --- .../ZUGFeRD/model/TaxCategoryCodeTypeConstants.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/model/TaxCategoryCodeTypeConstants.java b/library/src/main/java/org/mustangproject/ZUGFeRD/model/TaxCategoryCodeTypeConstants.java index c400cbbc..c9ecc2a0 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/model/TaxCategoryCodeTypeConstants.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/model/TaxCategoryCodeTypeConstants.java @@ -29,6 +29,7 @@ public class TaxCategoryCodeTypeConstants { public static final String ZEROTAXPRODUCTS = "Z"; public static final String UNTAXEDSERVICE = "O"; public static final String INTRACOMMUNITY = "K"; - - public static Set CATEGORY_CODES_WITH_EXEMPTION_REASON = Stream.of(INTRACOMMUNITY, REVERSECHARGE, TAXEXEMPT).collect(Collectors.toSet()); + public static final String FREEEXPORT = "G"; + + public static Set CATEGORY_CODES_WITH_EXEMPTION_REASON = Stream.of(INTRACOMMUNITY, REVERSECHARGE, TAXEXEMPT, FREEEXPORT).collect(Collectors.toSet()); } From 4fce6aa8f686909cafa6e7e62f89bdd2bd257749 Mon Sep 17 00:00:00 2001 From: Malte Neumann Date: Tue, 3 Dec 2024 18:30:10 +0100 Subject: [PATCH 02/36] Close FileInputStream safely in ZUGFeRDExporterFromPDFA --- .../org/mustangproject/ZUGFeRD/ZUGFeRDExporterFromPDFA.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDExporterFromPDFA.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDExporterFromPDFA.java index 498ae7dc..c3b9299b 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDExporterFromPDFA.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDExporterFromPDFA.java @@ -83,8 +83,9 @@ public class ZUGFeRDExporterFromPDFA implements IZUGFeRDExporter { } protected byte[] filenameToByteArray(String pdfFilename) throws IOException { - FileInputStream fileInputStream = new FileInputStream(pdfFilename); - return inputstreamToByteArray(fileInputStream); + try (FileInputStream fileInputStream = new FileInputStream(pdfFilename)) { + return inputstreamToByteArray(fileInputStream); + } } protected byte[] inputstreamToByteArray(InputStream fileInputStream) throws IOException { From 6091fed2149aab50fdb69d329f943029ccb3e095 Mon Sep 17 00:00:00 2001 From: Heavenfighter <33938595+Heavenfighter@users.noreply.github.com> Date: Fri, 13 Dec 2024 13:46:20 +0100 Subject: [PATCH 03/36] #356 Added cli parameter to generate basic pdf version of xml report --- .../org/mustangproject/commandline/Main.java | 19 +- .../ZUGFeRD/ValidationLogVisualizer.java | 148 +++++++++++++ .../main/resources/stylesheets/result-pdf.xsl | 203 ++++++++++++++++++ 3 files changed, 367 insertions(+), 3 deletions(-) create mode 100644 library/src/main/java/org/mustangproject/ZUGFeRD/ValidationLogVisualizer.java create mode 100644 library/src/main/resources/stylesheets/result-pdf.xsl diff --git a/Mustang-CLI/src/main/java/org/mustangproject/commandline/Main.java b/Mustang-CLI/src/main/java/org/mustangproject/commandline/Main.java index 6687297e..275da445 100755 --- a/Mustang-CLI/src/main/java/org/mustangproject/commandline/Main.java +++ b/Mustang-CLI/src/main/java/org/mustangproject/commandline/Main.java @@ -19,6 +19,7 @@ package org.mustangproject.commandline; import org.apache.commons.cli.*; +import org.apache.commons.io.FilenameUtils; import org.mustangproject.CII.CIIToUBL; import org.mustangproject.EStandard; import org.mustangproject.FileAttachment; @@ -84,6 +85,7 @@ public class Main { + " [--logAppend ]: text to be added to log line\n" + " Additional parameters (optional - user will be prompted if not defined)\n" + " [--source ]: input PDF or XML file\n" + + " [--log-as-pdf]: save log output as pdf\n" + " --action validateExpectInvalid validate directory expecting negative results \n" + " [--no-notices]: refrain from reporting notices\n" + " Additional parameters (optional - user will be prompted if not defined)\n" @@ -357,6 +359,7 @@ public class Main { options.addOption(new Option("d", "directory", true, "which directory to operate on")); options.addOption(new Option("i", "ignorefileextension", false, "ignore non-matching file extensions")); options.addOption(new Option("l", "listfromstdin", false, "take list of files from commandline")); + options.addOption(new Option("log-as-pdf", "log-as-pdf", false, "saving log output to pdf file")); boolean optionsRecognized = false; String action = ""; @@ -380,6 +383,7 @@ public class Main { String format = cmd.getOptionValue("format"); String lang = cmd.getOptionValue("language"); Boolean noNotices = cmd.hasOption("no-notices"); + Boolean LogAsPDF = cmd.hasOption("log-as-pdf"); String zugferdVersion = cmd.getOptionValue("version"); String zugferdProfile = cmd.getOptionValue("profile"); @@ -427,7 +431,7 @@ public class Main { performUBL(sourceName, outName); optionsRecognized = true; } else if ((action != null) && (action.equals("validate"))) { - optionsRecognized = performValidate(sourceName, noNotices, cmd.getOptionValue("logAppend")); + optionsRecognized = performValidate(sourceName, noNotices, cmd.getOptionValue("logAppend"), LogAsPDF); } else if ((action != null) && (action.equals("validateExpectValid"))) { optionsRecognized = performValidateExpect(true, directoryName); } else if ((action != null) && (action.equals("validateExpectInvalid"))) { @@ -454,7 +458,7 @@ public class Main { } - private static boolean performValidate(String sourceName, boolean noNotices, String logAppend) { + private static boolean performValidate(String sourceName, boolean noNotices, String logAppend, boolean createLogAsPDF) { boolean optionsRecognized; if (sourceName == null) { sourceName = getFilenameFromUser("Source PDF or XML", "invoice.pdf", "pdf|xml", true, false); @@ -466,7 +470,16 @@ public class Main { if (noNotices) { zfv.disableNotices(); } - System.out.println(zfv.validate(sourceName)); + + String validationResultXML = zfv.validate(sourceName); + System.out.println(validationResultXML); + + if( createLogAsPDF) { + ValidationLogVisualizer vlvi = new ValidationLogVisualizer(); + String fileBasename = FilenameUtils.getBaseName(sourceName); + + vlvi.toPDF(validationResultXML, fileBasename + "_result.pdf"); + } optionsRecognized = !zfv.hasOptionsError(); if (!zfv.wasCompletelyValid()) { System.exit(-1); diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ValidationLogVisualizer.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ValidationLogVisualizer.java new file mode 100644 index 00000000..686daa7c --- /dev/null +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ValidationLogVisualizer.java @@ -0,0 +1,148 @@ +package org.mustangproject.ZUGFeRD; + +import org.apache.fop.apps.*; +import org.apache.fop.apps.io.ResourceResolverFactory; +import org.apache.fop.configuration.Configuration; +import org.apache.fop.configuration.ConfigurationException; +import org.apache.fop.configuration.DefaultConfigurationBuilder; +import org.apache.xmlgraphics.util.MimeConstants; +import org.mustangproject.ClasspathResolverURIAdapter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +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; + +public class ValidationLogVisualizer { + public enum Language { + EN, + FR, + DE + } + + static final ClassLoader CLASS_LOADER = ValidationLogVisualizer.class.getClassLoader(); + private static final String RESOURCE_PATH = ""; + private static final Logger LOGGER = LoggerFactory.getLogger(ValidationLogVisualizer.class); + + private TransformerFactory mFactory = null; + private Templates mXsltPDFTemplate = null; + + + public ValidationLogVisualizer() { + mFactory = new net.sf.saxon.TransformerFactoryImpl(); + // fact = TransformerFactory.newInstance(); + mFactory.setURIResolver(new ValidationLogVisualizer.ClasspathResourceURIResolver()); + } + + protected void applyXSLTToPDF(final String xmlContent, final OutputStream PDFOutstream) + throws TransformerException { + Transformer transformer = mXsltPDFTemplate.newTransformer(); + + transformer.transform(new StreamSource(new StringReader(xmlContent)), new StreamResult(PDFOutstream)); + } + + protected String toFOP(final String xmlContent) + throws TransformerException { + + try { + if (mXsltPDFTemplate == null) { + mXsltPDFTemplate = mFactory.newTemplates( + new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/result-pdf.xsl"))); + } + } catch (TransformerConfigurationException ex) { + LOGGER.error("Failed to init XSLT templates", ex); + } + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + try { + + applyXSLTToPDF(xmlContent, baos); + + } catch (Exception e1) { + LOGGER.error("Failed to create PDF", e1); + } + + return baos.toString(StandardCharsets.UTF_8); + } + + public void toPDF(String xmlLogfileContent, String pdfFilename) { + + // the writing part + + String result = null; + + /* remove file endings so that tests can also pass after checking + out from git with arbitrary options (which may include CSRF changes) + */ + try { + result = this.toFOP(xmlLogfileContent); + } catch ( TransformerException e) { + LOGGER.error("Failed to apply FOP", e); + } + DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); + + Configuration cfg = null; + try { + cfg = cfgBuilder.build(CLASS_LOADER.getResourceAsStream("fop-config.xconf")); + } catch (ConfigurationException e) { + throw new RuntimeException(e); + } + + FopFactoryBuilder builder = new FopFactoryBuilder(new File(".").toURI(), new ClasspathResolverURIAdapter()).setConfiguration(cfg); +// Step 1: Construct a FopFactory by specifying a reference to the configuration file +// (reuse if you plan to render multiple documents!) + + FopFactory fopFactory = builder.build(); + + fopFactory.getFontManager().setResourceResolver( + ResourceResolverFactory.createInternalResourceResolver( + new File(".").toURI(), + new ClasspathResolverURIAdapter())); + + FOUserAgent userAgent = fopFactory.newFOUserAgent(); + + userAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-3b"); + +// Step 2: Set up output stream. +// Note: Using BufferedOutputStream for performance reasons (helpful with FileOutputStreams). + + try (OutputStream out = new BufferedOutputStream(new FileOutputStream(pdfFilename))) { + + // Step 3: Construct fop with desired output format + Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out); + + // Step 4: Setup JAXP using identity transformer + TransformerFactory factory = TransformerFactory.newInstance(); + Transformer transformer = factory.newTransformer(); // identity transformer + + // Step 5: Setup input and output for XSLT transformation + // Setup input stream + Source src = new StreamSource(new ByteArrayInputStream(result.getBytes(StandardCharsets.UTF_8))); + + // Resulting SAX events (the generated FO) must be piped through to FOP + Result res = new SAXResult(fop.getDefaultHandler()); + + // Step 6: Start XSLT transformation and FOP processing + transformer.transform(src, res); + + } catch (FOPException | IOException | TransformerException e) { + LOGGER.error("Failed to create PDF", e); + } + } + + private static class ClasspathResourceURIResolver implements URIResolver { + ClasspathResourceURIResolver() { + // Do nothing, just prevents synthetic access warning. + } + + @Override + public Source resolve(String href, String base) throws TransformerException { + return new StreamSource(CLASS_LOADER.getResourceAsStream(RESOURCE_PATH + "stylesheets/" + href)); + } + } +} diff --git a/library/src/main/resources/stylesheets/result-pdf.xsl b/library/src/main/resources/stylesheets/result-pdf.xsl new file mode 100644 index 00000000..ff64d0cb --- /dev/null +++ b/library/src/main/resources/stylesheets/result-pdf.xsl @@ -0,0 +1,203 @@ + + + + + + + + + + + + + + + + + green + + + red + + + + + + green + + + red + + + + + + Das ZUGFeRD-PDF ist valide. + + + Das ZUGFeRD-PDF ist nicht valide. + + + + + + Es wird empfohlen das Dokument anzunehmen und weiter zu verarbeiten. + + + Es wird empfohlen das Dokument zurückzuweisen. + + + + + + + + + + + + + + + Prüfbericht + + + + + + + + + + + + + + + Referenz: + + + + + + + + + + Zeitpunkt der Prüfung: + + + + + + + + + + Erkannter Dokumenttyp: + + + + + + + + + + + + + Validierungsergebnisse im Detail: + + + + + + + + + Type + + + Code + + + Text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Pfad: + + + + + + + + + + + + + + + + + + + + + + + + + + + + From ecd41bbc34000ce15d804801b8dc37361a0e5988 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Wed, 18 Dec 2024 21:24:53 +0100 Subject: [PATCH 04/36] corrected parseException --- .../ZUGFeRD/ZUGFeRDInvoiceImporter.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java index ffcfaac1..05aae56e 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java @@ -68,7 +68,6 @@ public class ZUGFeRDInvoiceImporter { protected CalculatedInvoice importedInvoice = null; protected boolean recalcPrice = false; protected boolean ignoreCalculationErrors = false; - protected ArrayList fileAttachments = new ArrayList<>(); public ZUGFeRDInvoiceImporter() { //constructor for extending classes @@ -239,7 +238,7 @@ public class ZUGFeRDInvoiceImporter { try { setDocument(); - } catch (ParserConfigurationException | SAXException e) { + } catch (ParserConfigurationException | SAXException | ParseException e) { LOGGER.error("Failed to parse XML", e); throw new ZUGFeRDExportException(e); } @@ -255,7 +254,7 @@ public class ZUGFeRDInvoiceImporter { setRawXML(rawXML, true); } - private void setDocument() throws ParserConfigurationException, IOException, SAXException { + private void setDocument() throws ParserConfigurationException, IOException, SAXException, ParseException { final DocumentBuilderFactory xmlFact = DocumentBuilderFactory.newInstance(); xmlFact.setNamespaceAware(true); final DocumentBuilder builder = xmlFact.newDocumentBuilder(); @@ -268,8 +267,6 @@ public class ZUGFeRDInvoiceImporter { extractInto(importedInvoice); } catch (XPathExpressionException e) { throw new RuntimeException(e); - } catch (ParseException e) { - throw new RuntimeException(e); } } } @@ -844,7 +841,7 @@ public class ZUGFeRDInvoiceImporter { NodeList attachmentNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); for (int i = 0; i < attachmentNodes.getLength(); i++) { FileAttachment fa = new FileAttachment(attachmentNodes.item(i).getAttributes().getNamedItem("filename").getNodeValue(), attachmentNodes.item(i).getAttributes().getNamedItem("mimeCode").getNodeValue(), "Data", Base64.getDecoder().decode(XMLTools.trimOrNull(attachmentNodes.item(i)))); - fileAttachments.add(fa); + zpp.embedFileInXML(fa); // filename = "Aufmass.png" mimeCode = "image/png" //EmbeddedDocumentBinaryObject cbc:EmbeddedDocumentBinaryObject mimeCode="image/png" filename="Aufmass.png" } @@ -1028,9 +1025,10 @@ public class ZUGFeRDInvoiceImporter { * * @return the file attachments embedded in XML (using base64) decoded as byte array, * for PDF embedded files in FX use getFileAttachmentsPDF() + * @deprecated use invoice.getAdditionalReferencedDocuments */ public List getFileAttachmentsXML() { - return fileAttachments; + return new ArrayList<>(Arrays.asList(importedInvoice.getAdditionalReferencedDocuments())); } /*** From 8e06e5cd896334cb081842be02960445ef3360fa Mon Sep 17 00:00:00 2001 From: jstaerk Date: Wed, 18 Dec 2024 21:40:48 +0100 Subject: [PATCH 05/36] no message --- History.md | 2 ++ .../src/main/java/org/mustangproject/Invoice.java | 15 +++++++++++---- .../java/org/mustangproject/ZUGFeRD/XRTest.java | 6 +++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/History.md b/History.md index 5641348b..a23a614a 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,6 @@ - correcly write charge reason codes also for non-Xrechnung +- correctly import additional referenced documents into invoice/corrected setting of attachments from jackson +- corrected parseException structure 2.15.1 ======= diff --git a/library/src/main/java/org/mustangproject/Invoice.java b/library/src/main/java/org/mustangproject/Invoice.java index 10ba057f..648ba71f 100644 --- a/library/src/main/java/org/mustangproject/Invoice.java +++ b/library/src/main/java/org/mustangproject/Invoice.java @@ -21,10 +21,7 @@ package org.mustangproject; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Date; -import java.util.List; +import java.util.*; import com.fasterxml.jackson.annotation.JsonInclude; import org.mustangproject.ZUGFeRD.*; @@ -116,6 +113,16 @@ public class Invoice implements IExportableTransaction { } + /*** + * setter in case e.g. jackson tries to map attachments (normal use embedFileInXML) + * @param fileArr Array of FileAttachments + * @return fluent setter + */ + public Invoice setAdditionalReferencedDocuments(FileAttachment[] fileArr) { + xmlEmbeddedFiles = new ArrayList<>(Arrays.asList(fileArr)); + return this; + } + @Override public IZUGFeRDCashDiscount[] getCashDiscounts() { return cashDiscounts.toArray(new IZUGFeRDCashDiscount[0]); diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java index 5a263eca..3efa4ccf 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java @@ -136,11 +136,11 @@ public class XRTest extends TestCase { } catch (IOException e) { fail("IOException not expected"); } - List attachedFiles=zii.getFileAttachmentsXML(); + FileAttachment[] attachedFiles=readInvoice.getAdditionalReferencedDocuments(); assertNotNull(attachedFiles); - assertEquals(attachedFiles.size(), 1); + assertEquals(attachedFiles.length, 1); - assertTrue(Arrays.equals(attachedFiles.get(0).getData(), b)); + assertTrue(Arrays.equals(attachedFiles[0].getData(), b)); } From 4a44bf09417a265b9f5b995f36a3f2b637898643 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Thu, 19 Dec 2024 06:25:24 +0100 Subject: [PATCH 06/36] correcting an issue --- History.md | 1 + .../main/java/org/mustangproject/validator/PDFValidator.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index a23a614a..d0423352 100644 --- a/History.md +++ b/History.md @@ -1,6 +1,7 @@ - correcly write charge reason codes also for non-Xrechnung - correctly import additional referenced documents into invoice/corrected setting of attachments from jackson - corrected parseException structure +- allow 1p0 as potential xmp version number 2.15.1 ======= diff --git a/validator/src/main/java/org/mustangproject/validator/PDFValidator.java b/validator/src/main/java/org/mustangproject/validator/PDFValidator.java index a73e1aa6..15a4108a 100644 --- a/validator/src/main/java/org/mustangproject/validator/PDFValidator.java +++ b/validator/src/main/java/org/mustangproject/validator/PDFValidator.java @@ -241,7 +241,7 @@ public class PDFValidator extends Validator { boolean versionValid = false; for (int i = 0; i < nodes.getLength(); i++) { - final String[] valueArray = {"1.0", "2p0", "1.2", "2.0", "2.1", "2.2", "2.3", "3.0"}; //1.2, 2.0, 2.1, 2.2, 2.3 and 3.0 are for xrechnung 1.2, 2p0 can be ZF 2.0, 2.1, 2.1.1 + final String[] valueArray = {"1.0", "1p0", "2p0", "1.2", "2.0", "2.1", "2.2", "2.3", "3.0"}; //1.2, 2.0, 2.1, 2.2, 2.3 and 3.0 are for xrechnung 1.2, 2p0 can be ZF 2.0, 2.1, 2.1.1 if (stringArrayContains(valueArray, nodes.item(i).getTextContent())) { versionValid = true; From e6ffd658f698c05190f017eea6a78ed30d49eadf Mon Sep 17 00:00:00 2001 From: jstaerk Date: Thu, 19 Dec 2024 12:59:15 +0100 Subject: [PATCH 07/36] closes #618 --- History.md | 3 ++- .../java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java | 2 +- .../mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java | 9 +++++++++ .../mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java | 3 ++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/History.md b/History.md index d0423352..62eeec43 100644 --- a/History.md +++ b/History.md @@ -1,7 +1,8 @@ -- correcly write charge reason codes also for non-Xrechnung +- correcly write charge reason codes also for non-Xrechnung #617 - correctly import additional referenced documents into invoice/corrected setting of attachments from jackson - corrected parseException structure - allow 1p0 as potential xmp version number +- #618 import BT-20 2.15.1 ======= diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java index da2c8792..5189bee6 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java @@ -262,7 +262,7 @@ public class ZUGFeRDImporter extends ZUGFeRDInvoiceImporter { * @return the Payment Terms */ public String getPaymentTerms() { - return extractString("//*[local-name() = 'SpecifiedTradePaymentTerms']//*[local-name() = 'Description']"); + return importedInvoice.getPaymentTermDescription(); } /** diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java index 05aae56e..da10d8dd 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java @@ -644,6 +644,12 @@ public class ZUGFeRDInvoiceImporter { String currency = extractString("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]/*[local-name()=\"InvoiceCurrencyCode\"]|//*[local-name()=\"DocumentCurrencyCode\"]"); zpp.setCurrency(currency); + String paymentTermsDescription = extractString("//*[local-name()=\"SpecifiedTradePaymentTerms\"]/*[local-name()=\"Description\"]|//*[local-name()=\"PaymentTerms\"]/*[local-name()=\"Note\"]"); + if ((paymentTermsDescription!=null)&&(!paymentTermsDescription.isEmpty())) { + zpp.setPaymentTermDescription(paymentTermsDescription); + } + + xpr = xpath.compile("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]|//*[local-name()=\"ApplicableSupplyChainTradeSettlement\"]"); NodeList headerTradeSettlementNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); List bankDetails = new ArrayList<>(); @@ -660,6 +666,9 @@ public class ZUGFeRDInvoiceImporter { && (headerTradeSettlementChilds.item(settlementChildIndex).getLocalName().equals("SpecifiedTradePaymentTerms"))) { NodeList paymentTermChilds = headerTradeSettlementChilds.item(settlementChildIndex).getChildNodes(); for (int paymentTermChildIndex = 0; paymentTermChildIndex < paymentTermChilds.getLength(); paymentTermChildIndex++) { + if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("Description"))) { + zpp.setPaymentTermDescription(paymentTermChilds.item(paymentTermChildIndex).getTextContent()); + } if ((paymentTermChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("DueDateDateTime"))) { NodeList dueDateChilds = paymentTermChilds.item(paymentTermChildIndex).getChildNodes(); for (int dueDateChildIndex = 0; dueDateChildIndex < dueDateChilds.getLength(); dueDateChildIndex++) { diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java index b6fac219..9771c76d 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java @@ -76,6 +76,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { assertEquals("LTR", invoice.getZFItems()[2].getProduct().getUnit()); assertEquals("7.00", invoice.getZFItems()[0].getProduct().getVATPercent().toString()); assertEquals("RE-20170509/505", invoice.getNumber()); + assertEquals("Zahlbar ohne Abzug bis zum 30.05.2017", invoice.getPaymentTermDescription()); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); assertEquals("2017-05-09", sdf.format(invoice.getIssueDate())); @@ -127,7 +128,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(),"Something"); assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().size(),1); assertEquals("400", invoice.getZFItems()[1].getQuantity().toString()); - + assertEquals("Zahlbar ohne Abzug bis zum 30.05.2017", invoice.getPaymentTermDescription()); assertEquals("AB321", invoice.getReferenceNumber()); assertEquals("160", invoice.getZFItems()[0].getPrice().toString()); assertEquals("Heiße Luft pro Liter", invoice.getZFItems()[2].getProduct().getName()); From c54ad5c474243a94f773cc83515fcfc123043cc1 Mon Sep 17 00:00:00 2001 From: Sebastian Sieber Date: Tue, 5 Nov 2024 11:59:32 +0100 Subject: [PATCH 08/36] Extract common code (cherry picked from commit bf03fe99a05221d565bda67582e0ad5589495285) --- .../src/main/resources/stylesheets/xrechnung-html.univ.xsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl index 21b2883d..1856fd51 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl @@ -1151,7 +1151,7 @@ function downloadData (element_id) {
- +
@@ -1564,8 +1564,8 @@ function downloadData (element_id) {
- - + +
From 500a25c3bd8bcf418adc8cdbc0d3d6a8d1563d1e Mon Sep 17 00:00:00 2001 From: Sebastian Sieber Date: Tue, 5 Nov 2024 12:32:43 +0100 Subject: [PATCH 09/36] Add ServiceLogisticsCharge to visualization (cherry picked from commit dd8a95ef4bf9e8bc47b411434136995a2df8b6f0) --- .../stylesheets/xrechnung-html.univ.xsl | 35 +++++++++++ .../ZUGFeRD/VisualizationTest.java | 60 ++++++++++++++++--- .../test/resources/factur-x-vis-ubl.en.html | 1 + 3 files changed, 89 insertions(+), 7 deletions(-) diff --git a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl index 1856fd51..b252b0e0 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl @@ -1151,6 +1151,10 @@ function downloadData (element_id) {
+ +
+ +
@@ -1564,6 +1568,37 @@ function downloadData (element_id) {
+ + + +
+
+
+
+
+
:
+
+
+
+
+
+
netto
+
+
+
+
+
+
+
+
+
+
:
+
+
+
+
+
+ diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java index a59199f4..c45f87df 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java @@ -66,6 +66,47 @@ public class VisualizationTest extends ResourceCase { .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()); + } + + + assertNotNull(result); + // Reading ZUGFeRD + assertEquals(expected, result); + } + + 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).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) { @@ -124,6 +165,7 @@ public class VisualizationTest extends ResourceCase { } + assertNotNull(result); // Reading ZUGFeRD assertEquals(expected, result); @@ -141,10 +183,18 @@ public class VisualizationTest extends ResourceCase { /* 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).replace("\r", "").replace("\n", "").replace("\t", "").replace(" ", ""); + result = zvi.visualize(UBLinputFile.getAbsolutePath(), ZUGFeRDVisualizer.Language.EN) + .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(" ", ""); + expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8) + .replace("\r", "") + .replace("\n", "") + .replace("\t", "") + .replace(" ", ""); // remove linebreaks as well... } catch (UnsupportedOperationException e) { @@ -162,12 +212,12 @@ public class VisualizationTest extends ResourceCase { } + assertNotNull(result); // Reading ZUGFeRD assertEquals(expected, result); } - public void testUBLVisualizationBasic() { // the writing part @@ -198,10 +248,6 @@ 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()); } 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..34d420e8 100644 --- a/library/src/test/resources/factur-x-vis-ubl.en.html +++ b/library/src/test/resources/factur-x-vis-ubl.en.html @@ -2,6 +2,7 @@ + XRechnung - - -
- -
-
-
-
-
We accept no liability for the correctness of the data
-
-
-
-
Buyer Information
-
-
-
Routing ID:
-
04011000-12345-03
-
-
-
Name:
-
[Buyer name]
-
-
-
Street / house number:
-
[Buyer address line 1]
-
-
-
PO Box:
-
-
-
-
Address Addition:
-
-
-
-
Postcode:
-
12345
-
-
-
Place:
-
[Buyer city]
-
-
-
State/Province:
-
-
-
-
Country:
-
DE (Deutschland)
-
-
-
ID:
-
[Buyer identifier]
-
-
-
ID scheme:
-
-
-
-
Name:
-
-
-
-
Phone:
-
-
-
-
E-mail address:
-
-
-
-
-
-
-
Seller Information
-
-
-
-
-
-
-
Company name:
-
[Seller name]
-
-
-
Street / house number:
-
[Seller address line 1]
-
-
-
PO Box:
-
-
-
-
Address Addition:
-
-
-
-
Code postal:
-
12345
-
-
-
Place:
-
[Seller city]
-
-
-
State/Province:
-
-
-
-
Country code:
-
DE (Deutschland)
-
-
-
ID:
-
-
-
-
ID scheme:
-
-
-
-
Name:
-
nicht vorhanden
-
-
-
Phone:
-
+49 1234-5678
-
-
-
E-mail address:
-
seller@email.de
-
-
-
-
-
-
-
-
-
Invoice details
-
-
-
-
-
Seller Information:
-
123456XX
-
-
-
Invoice date:
-
4.4.2016
-
-
-
Invoice type:
-
380 (Commercial invoice)
-
-
-
Currency
-
EUR (Euro)
-
-
-

Billing period:

-
-
-
from:
-
-
-
-
to:
-
-
-
-
-
-
-
-
-
Project number:
-
-
-
-
Contract Number:
-
-
-
-
Order number:
-
-
-
-
Order number:
-
-
-
-

Previous invoices:

-
-
-
-
-
-
-
-
-
Total amounts of the invoice
-
-
-
Line total
-
netto
-
314,86
-
-
-
Total discounts
-
netto
-
-
-
-
Total charges
-
netto
-
-
-
-
Grand total
-
netto
-
314,86
-
-
-
VAT amount
-
-
22,04
-
-
-
Total VAT
-
-
-
-
-
Grand total
-
brutto
-
336,90
-
-
-
Amount paid
-
brutto
-
-
-
-
rounding amount
-
brutto
-
-
-
-
Amount Due
-
brutto
-
336,90
-
-
-
-
-
-
-
-
-
Breakdown of VAT at invoice level
-
-
-
VAT category: S (Standard rate)
-
-
-
-
-
Grand total
-
netto
-
314,86
-
-
-
VAT rate
-
-
7%
-
-
-
VAT amount
-
-
22,04
-
-
-
-
Reason for exemption::
-
ID for the exemption reason::
-
-
-
-
-
-
-
-
-
-
-
Payment details
-
-
-
Discount; other payment terms:
-
Zahlbar sofort ohne Abzug.
-
-
-
Due date:
-
-
-
-
Code for the means of payment:
-
58 (SEPA credit transfer)
-
-
-
Means of payment:
-
-
-
-
Usage:
-
-
-
-
-
-
Card information
-
-
-
Card number:
-
-
-
-
Card holder:
-
-
-
-
-
-
-
-
-
-
Direct debit
-
-
-
Mandate Reference No:
-
-
-
-
IBAN:
-
-
-
-
Creditor ID:
-
-
-
-
-
-
Transfer
-
-
-
Account holder:
-
-
-
-
IBAN:
-
DE75512108001245126199
-
-
-
BIC:
-
-
-
-
-
-
-
-
-
-
Invoice Comment
-
-
-
Subject:
-
-
-
-
Comment:
-
#ADU#Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden.
-
-
-
-
-
-
-
-
We accept no liability for the correctness of the data
-
-
-
-
LineZeitschrift [...]
-
-
-
Free text:
-
Die letzte Lieferung im Rahmen des abgerechneten Abonnements erfolgt in 12/2016 Lieferung - erfolgt / erfolgte direkt vom Verlag
-
-
-
Object ID:
-
-
-
-
Object ID schema:
-
-
-
-
Order line number:
-
6171175.1
-
-
-
Account assignment information:
-
-
-

Billing period:

-
-
from:
-
1.1.2016
-
-
-
to:
-
31.12.2016
-
-
-
-
-
Price details
-
-
-
Quantity
-
1
-
-
-
Unit
-
XPP (Piece)
-
-
-
Unit price (net)
-
288,79
-
-
-
Total price (net)
-
288,79
-
-
-
-
-
Discount (net):
-
-
-
-
Net list price:
-
-
-
-
Number of units:
-
-
-
-
Unit of measure code:
-
-
-
-
VAT:
-
S (Standard rate)
-
-
-
VAT rate in percent:
-
7%
-
-
-
-
-
-
-
-
-
Allowances at line level
-
-
-
Charges at invoice line level
-
-
-
-
-
-
-
Item Information
-
-
-
-
-
-
Name:
-
Zeitschrift [...]
-
-
-
Description:
-
Zeitschrift Inland
-
-
-
Part number:
-
246
-
-
-
Customer's material number:
-
-
-

Article properties:

-
-
-
-
-
-
-
Item ID:
-
-
-
-
Item ID schema:
-
-
-
-
Item classification code:
-
0721-880X
-
-
-
Identifier to form the schema:
-
IB (ISBN (International Standard Book Number))
-
-
-
Version for creating the schema:
-
-
-
-
Country of origin code:
-
-
-
-
-
-
-
-
-
-
-
-
-
LinePorto + Versandkosten
-
-
-
Free text:
-
-
-
-
Object ID:
-
-
-
-
Object ID schema:
-
-
-
-
Order line number:
-
-
-
-
Account assignment information:
-
-
-

Billing period:

-
-
from:
-
-
-
-
to:
-
-
-
-
-
-
Price details
-
-
-
Quantity
-
1
-
-
-
Unit
-
XPP (Piece)
-
-
-
Unit price (net)
-
26,07
-
-
-
Total price (net)
-
26,07
-
-
-
-
-
Discount (net):
-
-
-
-
Net list price:
-
-
-
-
Number of units:
-
-
-
-
Unit of measure code:
-
-
-
-
VAT:
-
S (Standard rate)
-
-
-
VAT rate in percent:
-
7%
-
-
-
-
-
-
-
-
-
Allowances at line level
-
-
-
Charges at invoice line level
-
-
-
-
-
-
-
Item Information
-
-
-
-
-
-
Name:
-
Porto + Versandkosten
-
-
-
Description:
-
-
-
-
Part number:
-
-
-
-
Customer's material number:
-
-
-

Article properties:

-
-
-
-
-
-
-
Item ID:
-
-
-
-
Item ID schema:
-
-
-
-
Item classification code:
-
-
-
-
Identifier to form the schema:
-
-
-
-
Version for creating the schema:
-
-
-
-
Country of origin code:
-
-
-
-
-
-
-
-
-
-
-
-
We accept no liability for the correctness of the data
-
-
-
-
Seller Information
-
-
-
Differing trade name:
-
[Seller trading name]
-
-
-
State/Province:
-
-
-
-
Electronic address:
-
seller@email.de
-
-
-
Electronic address scheme:
-
EM (Electronic mail)
-
-
-
Register number:
-
[HRA-Eintrag]
-
-
-
VAT ID:
-
DE 123456789
-
-
-
Tax ID:
-
-
-
-
Tax ID scheme:
-
-
-
-
Further legal information:
-
123/456/7890, HRA-Eintrag in […]
-
-
-
VAT currency code:
-
-
-
-
-
-
-
-
-
-
-
Buyer Information
-
-
-
Differing trade name:
-
-
-
-
State/Province:
-
-
-
-
E-mail address:
-
buyer@info.de
-
-
-
Electronic address scheme:
-
EM (Electronic mail)
-
-
-
Register number:
-
-
-
-
Scheme of register/register number:
-
-
-
-
VAT ID:
-
-
-
-
VAT payday date:
-
-
-
-
VAT Statement Date Code:
-
-
-
-
Account assignment information:
-
-
-
-
-
-
-
-
-
-
-
Contract Information
-
-
-
Assignment number:
-
-
-
-
Receipt confirmation ID:
-
-
-
-
Dispatch note ID:
-
-
-
-
Process ID:
-
-
-
-
Specification ID:
-
urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
-
-
-
Object ID:
-
-
-
-
Object ID schema:
-
-
-
-
-
-
-
-
-
-
We accept no liability for the correctness of the data
-
-
-
-
Documents justifying the invoice
-
-
-
-
-
-
-
-
-
History
-
-
-
-
-
-
- + + + + + + XRechnung + + + + +
+ +
+
+
+
+
We accept no liability for the correctness of the data
+
+
+
+
Buyer Information
+
+
+
Routing ID:
+
04011000-12345-03
+
+
+
Name:
+
[Buyer name]
+
+
+
Street / house number:
+
[Buyer address line 1]
+
+
+
PO Box:
+
+
+
+
Address Addition:
+
+
+
+
Postcode:
+
12345
+
+
+
Place:
+
[Buyer city]
+
+
+
State/Province:
+
+
+
+
Country:
+
DE (Deutschland)
+
+
+
ID:
+
[Buyer identifier]
+
+
+
ID scheme:
+
+
+
+
Name:
+
+
+
+
Phone:
+
+
+
+
E-mail address:
+
+
+
+
+
+
+
Seller Information
+
+
+
+
+
+
+
Company name:
+
[Seller name]
+
+
+
Street / house number:
+
[Seller address line 1]
+
+
+
PO Box:
+
+
+
+
Address Addition:
+
+
+
+
Code postal:
+
12345
+
+
+
Place:
+
[Seller city]
+
+
+
State/Province:
+
+
+
+
Country code:
+
DE (Deutschland)
+
+
+
ID:
+
+
+
+
ID scheme:
+
+
+
+
Name:
+
nicht vorhanden
+
+
+
Phone:
+
+49 1234-5678
+
+
+
E-mail address:
+
seller@email.de
+
+
+
+
+
+
+
+
+
Invoice details
+
+
+
+
+
Seller Information:
+
123456XX
+
+
+
Invoice date:
+
4.4.2016
+
+
+
Invoice type:
+
380 (Commercial invoice)
+
+
+
Currency
+
EUR (Euro)
+
+
+

Billing period:

+
+
+
from:
+
+
+
+
to:
+
+
+
+
+
+
+
+
+
Project number:
+
+
+
+
Contract Number:
+
+
+
+
Order number:
+
+
+
+
Order number:
+
+
+
+

Previous invoices:

+
+
+
+
+
+
+
+
+
Total amounts of the invoice
+
+
+
Line total
+
netto
+
314,86
+
+
+
Total discounts
+
netto
+
+
+
+
Total charges
+
netto
+
+
+
+
Grand total
+
netto
+
314,86
+
+
+
VAT amount
+
+
22,04
+
+
+
Total VAT
+
+
+
+
+
Grand total
+
brutto
+
336,90
+
+
+
Amount paid
+
brutto
+
+
+
+
rounding amount
+
brutto
+
+
+
+
Amount Due
+
brutto
+
336,90
+
+
+
+
+
+
+
+
+
Breakdown of VAT at invoice level
+
+
+
VAT category: S (Standard rate)
+
+
+
+
+
Grand total
+
netto
+
314,86
+
+
+
VAT rate
+
+
7%
+
+
+
VAT amount
+
+
22,04
+
+
+
+
Reason for exemption::
+
ID for the exemption reason::
+
+
+
+
+
+
+
+
Payment details
+
+
+
Discount; other payment terms:
+
Zahlbar sofort ohne Abzug.
+
+
+
Due date:
+
+
+
+
Code for the means of payment:
+
58 (SEPA credit transfer)
+
+
+
Means of payment:
+
+
+
+
Usage:
+
+
+
+
+
+
Card information
+
+
+
Card number:
+
+
+
+
Card holder:
+
+
+
+
+
+
+
+
+
+
Direct debit
+
+
+
Mandate Reference No:
+
+
+
+
IBAN:
+
+
+
+
Creditor ID:
+
+
+
+
+
+
Transfer
+
+
+
Account holder:
+
+
+
+
IBAN:
+
DE75512108001245126199
+
+
+
BIC:
+
+
+
+
+
+
+
+
+
+
Invoice Comment
+
+
+
Subject:
+
+
+
+
Comment:
+
#ADU#Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden.
+
+
+
+
+
+
+
+
We accept no liability for the correctness of the data
+
+
+
+
LineZeitschrift [...]
+
+
+
Free text:
+
Die letzte Lieferung im Rahmen des abgerechneten Abonnements erfolgt in 12/2016 Lieferung + erfolgt / erfolgte direkt vom Verlag
+
+
+
Object ID:
+
+
+
+
Object ID schema:
+
+
+
+
Order line number:
+
6171175.1
+
+
+
Account assignment information:
+
+
+

Billing period:

+
+
from:
+
1.1.2016
+
+
+
to:
+
31.12.2016
+
+
+
+
+
Price details
+
+
+
Quantity
+
1
+
+
+
Unit
+
XPP (Piece)
+
+
+
Unit price (net)
+
288,79
+
+
+
Total price (net)
+
288,79
+
+
+
+
+
Discount (net):
+
+
+
+
Net list price:
+
+
+
+
Number of units:
+
+
+
+
Unit of measure code:
+
+
+
+
VAT:
+
S (Standard rate)
+
+
+
VAT rate in percent:
+
7%
+
+
+
+
+
+
+
+
+
Allowances at line level
+
+
+
Charges at invoice line level
+
+
+
+
+
+
+
Item Information
+
+
+
+
+
+
Name:
+
Zeitschrift [...]
+
+
+
Description:
+
Zeitschrift Inland
+
+
+
Part number:
+
246
+
+
+
Customer's material number:
+
+
+

Article properties:

+
+
+
+
+
+
+
Item ID:
+
+
+
+
Item ID schema:
+
+
+
+
Item classification code:
+
0721-880X
+
+
+
Identifier to form the schema:
+
IB (ISBN (International Standard Book Number))
+
+
+
Version for creating the schema:
+
+
+
+
Country of origin code:
+
+
+
+
+
+
+
+
+
+
+
+
+
LinePorto + Versandkosten
+
+
+
Free text:
+
+
+
+
Object ID:
+
+
+
+
Object ID schema:
+
+
+
+
Order line number:
+
+
+
+
Account assignment information:
+
+
+

Billing period:

+
+
from:
+
+
+
+
to:
+
+
+
+
+
+
Price details
+
+
+
Quantity
+
1
+
+
+
Unit
+
XPP (Piece)
+
+
+
Unit price (net)
+
26,07
+
+
+
Total price (net)
+
26,07
+
+
+
+
+
Discount (net):
+
+
+
+
Net list price:
+
+
+
+
Number of units:
+
+
+
+
Unit of measure code:
+
+
+
+
VAT:
+
S (Standard rate)
+
+
+
VAT rate in percent:
+
7%
+
+
+
+
+
+
+
+
+
Allowances at line level
+
+
+
Charges at invoice line level
+
+
+
+
+
+
+
Item Information
+
+
+
+
+
+
Name:
+
Porto + Versandkosten
+
+
+
Description:
+
+
+
+
Part number:
+
+
+
+
Customer's material number:
+
+
+

Article properties:

+
+
+
+
+
+
+
Item ID:
+
+
+
+
Item ID schema:
+
+
+
+
Item classification code:
+
+
+
+
Identifier to form the schema:
+
+
+
+
Version for creating the schema:
+
+
+
+
Country of origin code:
+
+
+
+
+
+
+
+
+
+
+
+
We accept no liability for the correctness of the data
+
+
+
+
Seller Information
+
+
+
Differing trade name:
+
[Seller trading name]
+
+
+
State/Province:
+
+
+
+
Electronic address:
+
seller@email.de
+
+
+
Electronic address scheme:
+
EM (Electronic mail)
+
+
+
Register number:
+
[HRA-Eintrag]
+
+
+
VAT ID:
+
DE 123456789
+
+
+
Tax ID:
+
+
+
+
Tax ID scheme:
+
+
+
+
Further legal information:
+
123/456/7890, HRA-Eintrag in […]
+
+
+
VAT currency code:
+
+
+
+
+
+
+
+
+
+
+
Buyer Information
+
+
+
Differing trade name:
+
+
+
+
State/Province:
+
+
+
+
E-mail address:
+
buyer@info.de
+
+
+
Electronic address scheme:
+
EM (Electronic mail)
+
+
+
Register number:
+
+
+
+
Scheme of register/register number:
+
+
+
+
VAT ID:
+
+
+
+
VAT payday date:
+
+
+
+
VAT Statement Date Code:
+
+
+
+
Account assignment information:
+
+
+
+
+
+
+
+
+
+
+
Contract Information
+
+
+
Assignment number:
+
+
+
+
Receipt confirmation ID:
+
+
+
+
Dispatch note ID:
+
+
+
+
Process ID:
+
+
+
+
Specification ID:
+
urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
+
+
+
Object ID:
+
+
+
+
Object ID schema:
+
+
+
+
+
+
+
+
+
+
We accept no liability for the correctness of the data
+
+
+
+
Documents justifying the invoice
+
+
+
+
+
+
+
+
+
History
+
+
+
+
+
+
+ diff --git a/library/src/test/resources/factur-x-vis.fr.html b/library/src/test/resources/factur-x-vis.fr.html index 0b91ac44..176d36e4 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 @@
-
-
-
From a42f7a8b26e28eae23f80a78ebbe02e2711b9008 Mon Sep 17 00:00:00 2001 From: Sebastian Sieber Date: Mon, 18 Nov 2024 08:27:23 +0100 Subject: [PATCH 12/36] Tests in separate methodes --- .../ZUGFeRD/VisualizationTest.java | 208 ++---------------- 1 file changed, 24 insertions(+), 184 deletions(-) diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java index c45f87df..a5e58983 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/VisualizationTest.java @@ -22,6 +22,7 @@ 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; @@ -40,162 +41,32 @@ 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) - .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()); - } - - - 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).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); - } - - 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).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() { + this.runZUGFeRDVisualization("ubl-creditnote.xml", "factur-x-vis-ubl-creditnote.en.html", Language.EN); + } - // the writing part - File UBLinputFile = getResourceAsFile("ubl-creditnote.xml"); + public void testUBLVisualizationBasic() { + this.runZUGFeRDVisualization("ubl/01.01a-INVOICE.ubl.xml", "factur-x-vis-ubl.en.html", Language.EN); + } + + 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) - .replace("\r", "") - .replace("\n", "") - .replace("\t", "") - .replace(" ", ""); + result = zvi.visualize(CIIinputFile.getAbsolutePath(), lang); - 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... + File expectedResult = getResourceAsFile(resultFileName); + expected = new String(Files.readAllBytes(expectedResult.toPath()), StandardCharsets.UTF_8); } catch (UnsupportedOperationException e) { fail("UnsupportedOperationException should not happen: " + e.getMessage()); @@ -212,48 +83,17 @@ public class VisualizationTest extends ResourceCase { } - assertNotNull(result); - // Reading ZUGFeRD - assertEquals(expected, result); - } - - public void testUBLVisualizationBasic() { - - // the writing part - File UBLinputFile = getResourceAsFile("ubl/01.01a-INVOICE.ubl.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).replace("\r", "").replace("\n", "") - .replace("\t", "") - .replace(" ", ""); - - File expectedResult = getResourceAsFile("factur-x-vis-ubl.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()); - } - - - 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() { From 86b35857d3c937531152eb0933d1304af2d70a34 Mon Sep 17 00:00:00 2001 From: Sebastian Sieber Date: Mon, 18 Nov 2024 08:31:38 +0100 Subject: [PATCH 13/36] Add delivery note to visualization --- .../src/main/resources/stylesheets/cii-xr.xsl | 5204 +++++++++-------- .../stylesheets/xrechnung-html.de.xsl | 455 +- .../stylesheets/xrechnung-html.en.xsl | 455 +- .../stylesheets/xrechnung-html.fr.xsl | 455 +- .../stylesheets/xrechnung-html.univ.xsl | 4 + .../resources/factur-x-vis-extended.de.html | 4 + .../factur-x-vis-ubl-creditnote.en.html | 4 + .../test/resources/factur-x-vis-ubl.en.html | 3900 ++++++------ .../src/test/resources/factur-x-vis.fr.html | 4 + 9 files changed, 5259 insertions(+), 5226 deletions(-) diff --git a/library/src/main/resources/stylesheets/cii-xr.xsl b/library/src/main/resources/stylesheets/cii-xr.xsl index 421fe673..a5477125 100644 --- a/library/src/main/resources/stylesheets/cii-xr.xsl +++ b/library/src/main/resources/stylesheets/cii-xr.xsl @@ -1,2597 +1,2607 @@ - - - - - - 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> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..f3f89253 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.de.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.de.xsl @@ -1,227 +1,228 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.en.xsl b/library/src/main/resources/stylesheets/xrechnung-html.en.xsl index dd251fb7..a17295f1 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.en.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.en.xsl @@ -1,227 +1,228 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl b/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl index ccbafdd0..b085010e 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl @@ -1,227 +1,228 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl index 9a7af0c0..b668a188 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl @@ -2235,6 +2235,10 @@ function downloadData (element_id) {
:
+
+
:
+
+
:
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 1d63ba13..94b5ac8b 100644 --- a/library/src/test/resources/factur-x-vis-extended.de.html +++ b/library/src/test/resources/factur-x-vis-extended.de.html @@ -2247,6 +2247,10 @@
Kennung der Versandanzeige:
+
+
Kennung des Lieferscheins:
+
L87654321012
+
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 1c7b7237..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 @@ -2354,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 65e10274..9903b576 100644 --- a/library/src/test/resources/factur-x-vis-ubl.en.html +++ b/library/src/test/resources/factur-x-vis-ubl.en.html @@ -1,1948 +1,1952 @@ - - - - - - XRechnung - - - - -
- -
-
-
-
-
We accept no liability for the correctness of the data
-
-
-
-
Buyer Information
-
-
-
Routing ID:
-
04011000-12345-03
-
-
-
Name:
-
[Buyer name]
-
-
-
Street / house number:
-
[Buyer address line 1]
-
-
-
PO Box:
-
-
-
-
Address Addition:
-
-
-
-
Postcode:
-
12345
-
-
-
Place:
-
[Buyer city]
-
-
-
State/Province:
-
-
-
-
Country:
-
DE (Deutschland)
-
-
-
ID:
-
[Buyer identifier]
-
-
-
ID scheme:
-
-
-
-
Name:
-
-
-
-
Phone:
-
-
-
-
E-mail address:
-
-
-
-
-
-
-
Seller Information
-
-
-
-
-
-
-
Company name:
-
[Seller name]
-
-
-
Street / house number:
-
[Seller address line 1]
-
-
-
PO Box:
-
-
-
-
Address Addition:
-
-
-
-
Code postal:
-
12345
-
-
-
Place:
-
[Seller city]
-
-
-
State/Province:
-
-
-
-
Country code:
-
DE (Deutschland)
-
-
-
ID:
-
-
-
-
ID scheme:
-
-
-
-
Name:
-
nicht vorhanden
-
-
-
Phone:
-
+49 1234-5678
-
-
-
E-mail address:
-
seller@email.de
-
-
-
-
-
-
-
-
-
Invoice details
-
-
-
-
-
Seller Information:
-
123456XX
-
-
-
Invoice date:
-
4.4.2016
-
-
-
Invoice type:
-
380 (Commercial invoice)
-
-
-
Currency
-
EUR (Euro)
-
-
-

Billing period:

-
-
-
from:
-
-
-
-
to:
-
-
-
-
-
-
-
-
-
Project number:
-
-
-
-
Contract Number:
-
-
-
-
Order number:
-
-
-
-
Order number:
-
-
-
-

Previous invoices:

-
-
-
-
-
-
-
-
-
Total amounts of the invoice
-
-
-
Line total
-
netto
-
314,86
-
-
-
Total discounts
-
netto
-
-
-
-
Total charges
-
netto
-
-
-
-
Grand total
-
netto
-
314,86
-
-
-
VAT amount
-
-
22,04
-
-
-
Total VAT
-
-
-
-
-
Grand total
-
brutto
-
336,90
-
-
-
Amount paid
-
brutto
-
-
-
-
rounding amount
-
brutto
-
-
-
-
Amount Due
-
brutto
-
336,90
-
-
-
-
-
-
-
-
-
Breakdown of VAT at invoice level
-
-
-
VAT category: S (Standard rate)
-
-
-
-
-
Grand total
-
netto
-
314,86
-
-
-
VAT rate
-
-
7%
-
-
-
VAT amount
-
-
22,04
-
-
-
-
Reason for exemption::
-
ID for the exemption reason::
-
-
-
-
-
-
-
-
Payment details
-
-
-
Discount; other payment terms:
-
Zahlbar sofort ohne Abzug.
-
-
-
Due date:
-
-
-
-
Code for the means of payment:
-
58 (SEPA credit transfer)
-
-
-
Means of payment:
-
-
-
-
Usage:
-
-
-
-
-
-
Card information
-
-
-
Card number:
-
-
-
-
Card holder:
-
-
-
-
-
-
-
-
-
-
Direct debit
-
-
-
Mandate Reference No:
-
-
-
-
IBAN:
-
-
-
-
Creditor ID:
-
-
-
-
-
-
Transfer
-
-
-
Account holder:
-
-
-
-
IBAN:
-
DE75512108001245126199
-
-
-
BIC:
-
-
-
-
-
-
-
-
-
-
Invoice Comment
-
-
-
Subject:
-
-
-
-
Comment:
-
#ADU#Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden.
-
-
-
-
-
-
-
-
We accept no liability for the correctness of the data
-
-
-
-
LineZeitschrift [...]
-
-
-
Free text:
-
Die letzte Lieferung im Rahmen des abgerechneten Abonnements erfolgt in 12/2016 Lieferung - erfolgt / erfolgte direkt vom Verlag
-
-
-
Object ID:
-
-
-
-
Object ID schema:
-
-
-
-
Order line number:
-
6171175.1
-
-
-
Account assignment information:
-
-
-

Billing period:

-
-
from:
-
1.1.2016
-
-
-
to:
-
31.12.2016
-
-
-
-
-
Price details
-
-
-
Quantity
-
1
-
-
-
Unit
-
XPP (Piece)
-
-
-
Unit price (net)
-
288,79
-
-
-
Total price (net)
-
288,79
-
-
-
-
-
Discount (net):
-
-
-
-
Net list price:
-
-
-
-
Number of units:
-
-
-
-
Unit of measure code:
-
-
-
-
VAT:
-
S (Standard rate)
-
-
-
VAT rate in percent:
-
7%
-
-
-
-
-
-
-
-
-
Allowances at line level
-
-
-
Charges at invoice line level
-
-
-
-
-
-
-
Item Information
-
-
-
-
-
-
Name:
-
Zeitschrift [...]
-
-
-
Description:
-
Zeitschrift Inland
-
-
-
Part number:
-
246
-
-
-
Customer's material number:
-
-
-

Article properties:

-
-
-
-
-
-
-
Item ID:
-
-
-
-
Item ID schema:
-
-
-
-
Item classification code:
-
0721-880X
-
-
-
Identifier to form the schema:
-
IB (ISBN (International Standard Book Number))
-
-
-
Version for creating the schema:
-
-
-
-
Country of origin code:
-
-
-
-
-
-
-
-
-
-
-
-
-
LinePorto + Versandkosten
-
-
-
Free text:
-
-
-
-
Object ID:
-
-
-
-
Object ID schema:
-
-
-
-
Order line number:
-
-
-
-
Account assignment information:
-
-
-

Billing period:

-
-
from:
-
-
-
-
to:
-
-
-
-
-
-
Price details
-
-
-
Quantity
-
1
-
-
-
Unit
-
XPP (Piece)
-
-
-
Unit price (net)
-
26,07
-
-
-
Total price (net)
-
26,07
-
-
-
-
-
Discount (net):
-
-
-
-
Net list price:
-
-
-
-
Number of units:
-
-
-
-
Unit of measure code:
-
-
-
-
VAT:
-
S (Standard rate)
-
-
-
VAT rate in percent:
-
7%
-
-
-
-
-
-
-
-
-
Allowances at line level
-
-
-
Charges at invoice line level
-
-
-
-
-
-
-
Item Information
-
-
-
-
-
-
Name:
-
Porto + Versandkosten
-
-
-
Description:
-
-
-
-
Part number:
-
-
-
-
Customer's material number:
-
-
-

Article properties:

-
-
-
-
-
-
-
Item ID:
-
-
-
-
Item ID schema:
-
-
-
-
Item classification code:
-
-
-
-
Identifier to form the schema:
-
-
-
-
Version for creating the schema:
-
-
-
-
Country of origin code:
-
-
-
-
-
-
-
-
-
-
-
-
We accept no liability for the correctness of the data
-
-
-
-
Seller Information
-
-
-
Differing trade name:
-
[Seller trading name]
-
-
-
State/Province:
-
-
-
-
Electronic address:
-
seller@email.de
-
-
-
Electronic address scheme:
-
EM (Electronic mail)
-
-
-
Register number:
-
[HRA-Eintrag]
-
-
-
VAT ID:
-
DE 123456789
-
-
-
Tax ID:
-
-
-
-
Tax ID scheme:
-
-
-
-
Further legal information:
-
123/456/7890, HRA-Eintrag in […]
-
-
-
VAT currency code:
-
-
-
-
-
-
-
-
-
-
-
Buyer Information
-
-
-
Differing trade name:
-
-
-
-
State/Province:
-
-
-
-
E-mail address:
-
buyer@info.de
-
-
-
Electronic address scheme:
-
EM (Electronic mail)
-
-
-
Register number:
-
-
-
-
Scheme of register/register number:
-
-
-
-
VAT ID:
-
-
-
-
VAT payday date:
-
-
-
-
VAT Statement Date Code:
-
-
-
-
Account assignment information:
-
-
-
-
-
-
-
-
-
-
-
Contract Information
-
-
-
Assignment number:
-
-
-
-
Receipt confirmation ID:
-
-
-
-
Dispatch note ID:
-
-
-
-
Process ID:
-
-
-
-
Specification ID:
-
urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
-
-
-
Object ID:
-
-
-
-
Object ID schema:
-
-
-
-
-
-
-
-
-
-
We accept no liability for the correctness of the data
-
-
-
-
Documents justifying the invoice
-
-
-
-
-
-
-
-
-
History
-
-
-
-
-
-
- + + + + + + XRechnung + + + + +
+ +
+
+
+
+
We accept no liability for the correctness of the data
+
+
+
+
Buyer Information
+
+
+
Routing ID:
+
04011000-12345-03
+
+
+
Name:
+
[Buyer name]
+
+
+
Street / house number:
+
[Buyer address line 1]
+
+
+
PO Box:
+
+
+
+
Address Addition:
+
+
+
+
Postcode:
+
12345
+
+
+
Place:
+
[Buyer city]
+
+
+
State/Province:
+
+
+
+
Country:
+
DE (Deutschland)
+
+
+
ID:
+
[Buyer identifier]
+
+
+
ID scheme:
+
+
+
+
Name:
+
+
+
+
Phone:
+
+
+
+
E-mail address:
+
+
+
+
+
+
+
Seller Information
+
+
+
+
+
+
+
Company name:
+
[Seller name]
+
+
+
Street / house number:
+
[Seller address line 1]
+
+
+
PO Box:
+
+
+
+
Address Addition:
+
+
+
+
Code postal:
+
12345
+
+
+
Place:
+
[Seller city]
+
+
+
State/Province:
+
+
+
+
Country code:
+
DE (Deutschland)
+
+
+
ID:
+
+
+
+
ID scheme:
+
+
+
+
Name:
+
nicht vorhanden
+
+
+
Phone:
+
+49 1234-5678
+
+
+
E-mail address:
+
seller@email.de
+
+
+
+
+
+
+
+
+
Invoice details
+
+
+
+
+
Seller Information:
+
123456XX
+
+
+
Invoice date:
+
4.4.2016
+
+
+
Invoice type:
+
380 (Commercial invoice)
+
+
+
Currency
+
EUR (Euro)
+
+
+

Billing period:

+
+
+
from:
+
+
+
+
to:
+
+
+
+
+
+
+
+
+
Project number:
+
+
+
+
Contract Number:
+
+
+
+
Order number:
+
+
+
+
Order number:
+
+
+
+

Previous invoices:

+
+
+
+
+
+
+
+
+
Total amounts of the invoice
+
+
+
Line total
+
netto
+
314,86
+
+
+
Total discounts
+
netto
+
+
+
+
Total charges
+
netto
+
+
+
+
Grand total
+
netto
+
314,86
+
+
+
VAT amount
+
+
22,04
+
+
+
Total VAT
+
+
+
+
+
Grand total
+
brutto
+
336,90
+
+
+
Amount paid
+
brutto
+
+
+
+
rounding amount
+
brutto
+
+
+
+
Amount Due
+
brutto
+
336,90
+
+
+
+
+
+
+
+
+
Breakdown of VAT at invoice level
+
+
+
VAT category: S (Standard rate)
+
+
+
+
+
Grand total
+
netto
+
314,86
+
+
+
VAT rate
+
+
7%
+
+
+
VAT amount
+
+
22,04
+
+
+
+
Reason for exemption::
+
ID for the exemption reason::
+
+
+
+
+
+
+
+
Payment details
+
+
+
Discount; other payment terms:
+
Zahlbar sofort ohne Abzug.
+
+
+
Due date:
+
+
+
+
Code for the means of payment:
+
58 (SEPA credit transfer)
+
+
+
Means of payment:
+
+
+
+
Usage:
+
+
+
+
+
+
Card information
+
+
+
Card number:
+
+
+
+
Card holder:
+
+
+
+
+
+
+
+
+
+
Direct debit
+
+
+
Mandate Reference No:
+
+
+
+
IBAN:
+
+
+
+
Creditor ID:
+
+
+
+
+
+
Transfer
+
+
+
Account holder:
+
+
+
+
IBAN:
+
DE75512108001245126199
+
+
+
BIC:
+
+
+
+
+
+
+
+
+
+
Invoice Comment
+
+
+
Subject:
+
+
+
+
Comment:
+
#ADU#Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden.
+
+
+
+
+
+
+
+
We accept no liability for the correctness of the data
+
+
+
+
LineZeitschrift [...]
+
+
+
Free text:
+
Die letzte Lieferung im Rahmen des abgerechneten Abonnements erfolgt in 12/2016 Lieferung + erfolgt / erfolgte direkt vom Verlag
+
+
+
Object ID:
+
+
+
+
Object ID schema:
+
+
+
+
Order line number:
+
6171175.1
+
+
+
Account assignment information:
+
+
+

Billing period:

+
+
from:
+
1.1.2016
+
+
+
to:
+
31.12.2016
+
+
+
+
+
Price details
+
+
+
Quantity
+
1
+
+
+
Unit
+
XPP (Piece)
+
+
+
Unit price (net)
+
288,79
+
+
+
Total price (net)
+
288,79
+
+
+
+
+
Discount (net):
+
+
+
+
Net list price:
+
+
+
+
Number of units:
+
+
+
+
Unit of measure code:
+
+
+
+
VAT:
+
S (Standard rate)
+
+
+
VAT rate in percent:
+
7%
+
+
+
+
+
+
+
+
+
Allowances at line level
+
+
+
Charges at invoice line level
+
+
+
+
+
+
+
Item Information
+
+
+
+
+
+
Name:
+
Zeitschrift [...]
+
+
+
Description:
+
Zeitschrift Inland
+
+
+
Part number:
+
246
+
+
+
Customer's material number:
+
+
+

Article properties:

+
+
+
+
+
+
+
Item ID:
+
+
+
+
Item ID schema:
+
+
+
+
Item classification code:
+
0721-880X
+
+
+
Identifier to form the schema:
+
IB (ISBN (International Standard Book Number))
+
+
+
Version for creating the schema:
+
+
+
+
Country of origin code:
+
+
+
+
+
+
+
+
+
+
+
+
+
LinePorto + Versandkosten
+
+
+
Free text:
+
+
+
+
Object ID:
+
+
+
+
Object ID schema:
+
+
+
+
Order line number:
+
+
+
+
Account assignment information:
+
+
+

Billing period:

+
+
from:
+
+
+
+
to:
+
+
+
+
+
+
Price details
+
+
+
Quantity
+
1
+
+
+
Unit
+
XPP (Piece)
+
+
+
Unit price (net)
+
26,07
+
+
+
Total price (net)
+
26,07
+
+
+
+
+
Discount (net):
+
+
+
+
Net list price:
+
+
+
+
Number of units:
+
+
+
+
Unit of measure code:
+
+
+
+
VAT:
+
S (Standard rate)
+
+
+
VAT rate in percent:
+
7%
+
+
+
+
+
+
+
+
+
Allowances at line level
+
+
+
Charges at invoice line level
+
+
+
+
+
+
+
Item Information
+
+
+
+
+
+
Name:
+
Porto + Versandkosten
+
+
+
Description:
+
+
+
+
Part number:
+
+
+
+
Customer's material number:
+
+
+

Article properties:

+
+
+
+
+
+
+
Item ID:
+
+
+
+
Item ID schema:
+
+
+
+
Item classification code:
+
+
+
+
Identifier to form the schema:
+
+
+
+
Version for creating the schema:
+
+
+
+
Country of origin code:
+
+
+
+
+
+
+
+
+
+
+
+
We accept no liability for the correctness of the data
+
+
+
+
Seller Information
+
+
+
Differing trade name:
+
[Seller trading name]
+
+
+
State/Province:
+
+
+
+
Electronic address:
+
seller@email.de
+
+
+
Electronic address scheme:
+
EM (Electronic mail)
+
+
+
Register number:
+
[HRA-Eintrag]
+
+
+
VAT ID:
+
DE 123456789
+
+
+
Tax ID:
+
+
+
+
Tax ID scheme:
+
+
+
+
Further legal information:
+
123/456/7890, HRA-Eintrag in […]
+
+
+
VAT currency code:
+
+
+
+
+
+
+
+
+
+
+
Buyer Information
+
+
+
Differing trade name:
+
+
+
+
State/Province:
+
+
+
+
E-mail address:
+
buyer@info.de
+
+
+
Electronic address scheme:
+
EM (Electronic mail)
+
+
+
Register number:
+
+
+
+
Scheme of register/register number:
+
+
+
+
VAT ID:
+
+
+
+
VAT payday date:
+
+
+
+
VAT Statement Date Code:
+
+
+
+
Account assignment information:
+
+
+
+
+
+
+
+
+
+
+
Contract Information
+
+
+
Assignment number:
+
+
+
+
Receipt confirmation ID:
+
+
+
+
Dispatch note ID:
+
+
+
+
Delivery note ID:
+
+
+
+
Process ID:
+
+
+
+
Specification ID:
+
urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0
+
+
+
Object ID:
+
+
+
+
Object ID schema:
+
+
+
+
+
+
+
+
+
+
We accept no liability for the correctness of the data
+
+
+
+
Documents justifying the invoice
+
+
+
+
+
+
+
+
+
History
+
+
+
+
+
+
+ diff --git a/library/src/test/resources/factur-x-vis.fr.html b/library/src/test/resources/factur-x-vis.fr.html index 176d36e4..e22b12ef 100644 --- a/library/src/test/resources/factur-x-vis.fr.html +++ b/library/src/test/resources/factur-x-vis.fr.html @@ -1924,6 +1924,10 @@
Identifiant du bordereau d'expédition:
+
+
Identifiant du bon de livraison:
+
+
Identifiant processus:
From 657706b02e4c65cb6ab637cf807995d6869f2c2b Mon Sep 17 00:00:00 2001 From: Sebastian Sieber Date: Mon, 18 Nov 2024 08:37:59 +0100 Subject: [PATCH 14/36] Add dates of deliviveries --- .../src/main/resources/stylesheets/cii-xr.xsl | 45 +- .../stylesheets/xrechnung-html.de.xsl | 1 + .../stylesheets/xrechnung-html.en.xsl | 1 + .../stylesheets/xrechnung-html.fr.xsl | 1 + .../stylesheets/xrechnung-html.univ.xsl | 50 +- .../src/test/resources/factur-x-extended.xml | 857 +++++++++--------- .../resources/factur-x-vis-extended.de.html | 2 +- .../test/resources/factur-x-vis-ubl.en.html | 1 - 8 files changed, 490 insertions(+), 468 deletions(-) diff --git a/library/src/main/resources/stylesheets/cii-xr.xsl b/library/src/main/resources/stylesheets/cii-xr.xsl index a5477125..f741c903 100644 --- a/library/src/main/resources/stylesheets/cii-xr.xsl +++ b/library/src/main/resources/stylesheets/cii-xr.xsl @@ -297,6 +297,14 @@ + + + + + + + + @@ -305,6 +313,14 @@ + + + + + + + + @@ -313,6 +329,14 @@ + + + + + + + + @@ -2447,8 +2471,9 @@ + - + + + + + + + + + + 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> + + + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.de.xsl b/library/src/main/resources/stylesheets/xrechnung-html.de.xsl index f3f89253..e2a2e930 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.de.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.de.xsl @@ -11,6 +11,7 @@ + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.en.xsl b/library/src/main/resources/stylesheets/xrechnung-html.en.xsl index a17295f1..c989a430 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.en.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.en.xsl @@ -11,6 +11,7 @@ + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl b/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl index b085010e..5be83bab 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.fr.xsl @@ -11,6 +11,7 @@ + diff --git a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl index b668a188..92689837 100644 --- a/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl +++ b/library/src/main/resources/stylesheets/xrechnung-html.univ.xsl @@ -1168,10 +1168,6 @@ function downloadData (element_id) { -
- -
-
@@ -1582,37 +1578,6 @@ function downloadData (element_id) { - -
-
-
-
-
-
:
-
-
-
-
-
-
netto
-
-
-
-
-
-
-
-
-
-
:
-
-
-
-
-
- - -
@@ -2229,15 +2194,24 @@ function downloadData (element_id) {
:
-
+
+ + +
:
-
+
+ + +
:
-
+
+ + +
:
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 94b5ac8b..ed5a147d 100644 --- a/library/src/test/resources/factur-x-vis-extended.de.html +++ b/library/src/test/resources/factur-x-vis-extended.de.html @@ -2249,7 +2249,7 @@
Kennung des Lieferscheins:
-
L87654321012
+
L87654321012 vom 31.10.2024
Prozesskennung:
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 9903b576..4a394f1c 100644 --- a/library/src/test/resources/factur-x-vis-ubl.en.html +++ b/library/src/test/resources/factur-x-vis-ubl.en.html @@ -2,7 +2,6 @@ - XRechnung