From ce0941848d600aeca3f53933d557b7517ca6688b Mon Sep 17 00:00:00 2001 From: langfr Date: Tue, 24 Jun 2025 15:22:45 +0100 Subject: [PATCH 01/40] =?UTF-8?q?Return=20Account=20Holder=C2=B4s=20name?= =?UTF-8?q?=20in=20prefrence=20over=20Seller=C2=B4s=20Name.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java | 10 ++++++++++ .../java/org/mustangproject/ZUGFeRD/ZF2PushTest.java | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java index cbf08b7b..5afa5a18 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDImporter.java @@ -351,6 +351,16 @@ public class ZUGFeRDImporter extends ZUGFeRDInvoiceImporter { public String getHolder() { + if (importedInvoice!=null && importedInvoice.getTradeSettlement()!=null) { + for (IZUGFeRDTradeSettlement settlement : importedInvoice.getTradeSettlement()) { + if (settlement instanceof IZUGFeRDTradeSettlementPayment) { + String s = ((IZUGFeRDTradeSettlementPayment) settlement).getAccountName(); + if ( s != null ) { + return s; + } + } + } + } return extractString("//*[local-name() = 'SellerTradeParty']/*[local-name() = 'Name']"); } diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java index 9c60b75b..75f516f6 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java @@ -114,8 +114,8 @@ public class ZF2PushTest extends TestCase { ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF); assertTrue(zi.getUTF8().contains("DE88200800000970375700")); //the iban assertTrue(zi.getUTF8().contains("Max Mustermann")); //account holder - assertTrue(zi.getUTF8().contains("DueDateDateTime")); //account holder - assertTrue(zi.getUTF8().contains("20201212")); //account holder + assertTrue(zi.getUTF8().contains("DueDateDateTime")); + assertTrue(zi.getUTF8().contains("20201212")); assertTrue(zi.getUTF8().contains(" Date: Thu, 3 Jul 2025 12:26:33 +0200 Subject: [PATCH 02/40] Fix Product Country of origin closes #861 --- .../main/java/org/mustangproject/Product.java | 10 ++-- .../ZUGFeRD/DeSerializationTest.java | 49 ++++++++++++------- .../test/resources/Extended_fremdwaehrung.xml | 4 ++ 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/library/src/main/java/org/mustangproject/Product.java b/library/src/main/java/org/mustangproject/Product.java index 4f0397ee..ef641dd0 100644 --- a/library/src/main/java/org/mustangproject/Product.java +++ b/library/src/main/java/org/mustangproject/Product.java @@ -1,13 +1,10 @@ package org.mustangproject; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.*; import org.mustangproject.ZUGFeRD.IDesignatedProductClassification; import org.mustangproject.ZUGFeRD.IZUGFeRDExportableProduct; import org.mustangproject.util.NodeMap; import org.w3c.dom.Node; -import org.w3c.dom.NodeList; import java.math.BigDecimal; import java.util.ArrayList; @@ -105,7 +102,10 @@ public class Product implements IZUGFeRDExportableProduct { classifications.add(new DesignatedProductClassification(classCode, className))); }); - nodeMap.getAsString("OriginTradeCounty").ifPresent(this::setCountryOfOrigin); + nodeMap.getAsNodeMap("OriginTradeCountry") + .flatMap(nodes -> nodes.getNode("ID")) + .map(Node::getTextContent) + .ifPresent(this::setCountryOfOrigin); } /*** diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java index bb41fb5a..c586df7a 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java @@ -21,6 +21,13 @@ */ package org.mustangproject.ZUGFeRD; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.FixMethodOrder; +import org.junit.runners.MethodSorters; +import org.mustangproject.*; +import org.mustangproject.ZUGFeRD.model.EventTimeCodeTypeConstants; + import java.io.File; import java.io.IOException; import java.math.BigDecimal; @@ -29,28 +36,11 @@ import java.nio.file.Files; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.TimeZone; import javax.xml.xpath.XPathExpressionException; -import org.junit.FixMethodOrder; -import org.junit.experimental.theories.FromDataPoints; -import org.junit.runners.MethodSorters; -import org.mustangproject.Allowance; -import org.mustangproject.BankDetails; -import org.mustangproject.CalculatedInvoice; -import org.mustangproject.CashDiscount; -import org.mustangproject.Charge; -import org.mustangproject.Contact; -import org.mustangproject.Invoice; -import org.mustangproject.Item; -import org.mustangproject.Product; -import org.mustangproject.SchemedID; -import org.mustangproject.TradeParty; -import org.mustangproject.ZUGFeRD.model.EventTimeCodeTypeConstants; +import static org.assertj.core.api.Assertions.assertThat; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class DeSerializationTest extends ResourceCase { @@ -71,6 +61,29 @@ public class DeSerializationTest extends ResourceCase { } + public void testProduct() throws IOException, XPathExpressionException, ParseException { + File inputCII = getResourceAsFile("Extended_fremdwaehrung.xml"); + var zii = new ZUGFeRDInvoiceImporter(); + zii.doIgnoreCalculationErrors(); + zii.fromXML(Files.readString(inputCII.toPath())); + var product = zii.extractInvoice() + .getZFItems()[0] + .getProduct(); + + assertThat(product.getCountryOfOrigin()).as("Product Country of origin") + .isEqualTo("DE"); + assertThat(product.getSellerAssignedID()).as("Product Seller assigned ID") + .isEqualTo("CO-123/V2A"); + assertThat(product.getBuyerAssignedID()).as("Product Buyer assigned ID") + .isEqualTo("Toolbox 0815"); + assertThat(product.getName()).as("Name") + .isEqualTo("Stahlcoil"); + + assertThat(product.getAttributes()).as("Product attributes") + .containsKey("LeoID") + .containsValue("704310.0105636504"); + } + public void testInvoiceLine() throws JsonProcessingException { File inputCII = getResourceAsFile("factur-x.xml"); boolean hasExceptions = false; diff --git a/library/src/test/resources/Extended_fremdwaehrung.xml b/library/src/test/resources/Extended_fremdwaehrung.xml index 4d10dea8..e5cb611d 100644 --- a/library/src/test/resources/Extended_fremdwaehrung.xml +++ b/library/src/test/resources/Extended_fremdwaehrung.xml @@ -131,6 +131,10 @@ costs, losses or damages could normally have been foreseen.--> CO-123/V2A Toolbox 0815 Stahlcoil + + LeoID + 704310.0105636504 + DE From 216fa91355592984329f7c8f173bea28da279ca7 Mon Sep 17 00:00:00 2001 From: Daniel Luckas Date: Thu, 17 Jul 2025 10:14:34 +0200 Subject: [PATCH 03/40] Close resources after usage --- .../org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java index 4cb47c4a..90baad58 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java @@ -126,8 +126,7 @@ public class ZUGFeRDInvoiceImporter { if (Arrays.equals(pad, pdfSignature)) { // we have a pdf - try { - PDDocument doc = Loader.loadPDF(IOUtils.toByteArray(pdfStream)); + try(PDDocument doc = Loader.loadPDF(IOUtils.toByteArray(pdfStream))) { // PDDocumentInformation info = doc.getDocumentInformation(); final PDDocumentNameDictionary names = new PDDocumentNameDictionary(doc.getDocumentCatalog()); //start From dc15c6e493cefe61848ce728e3df1476a307f17f Mon Sep 17 00:00:00 2001 From: jstaerk Date: Thu, 17 Jul 2025 12:32:40 +0200 Subject: [PATCH 04/40] closes #893 --- History.md | 4 +++ .../java/org/mustangproject/TradeParty.java | 26 +++++++++++++++++++ .../ZUGFeRD/DeSerializationTest.java | 21 ++++++++++++++- 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index 8585c2f4..256e7c9f 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,7 @@ +2.18.1 +======= +- #893 Tradeparty globalID is not read from JSON + 2.18.0 ======= 2025-07-14 diff --git a/library/src/main/java/org/mustangproject/TradeParty.java b/library/src/main/java/org/mustangproject/TradeParty.java index 73b1ae81..f5d34c84 100644 --- a/library/src/main/java/org/mustangproject/TradeParty.java +++ b/library/src/main/java/org/mustangproject/TradeParty.java @@ -541,6 +541,32 @@ public class TradeParty implements IZUGFeRDExportableTradeParty { return this; } + /*** + * for jackson, primarily, use addGlobalID(SchemedID) instead + * @param ID the id part without scheme + * @return fluent setter + */ + public TradeParty setGlobalID(String ID) { + if (globalId==null) { + globalId=new SchemedID(); + } + globalId.setId(ID); + return this; + } + + /*** + * for jackson, primarily, use addGlobalID(SchemedID) instead + * @param scheme the scheme part without id + * @return fluent setter + */ + public TradeParty setGlobalIDScheme(String scheme) { + if (globalId==null) { + globalId=new SchemedID(); + } + globalId.setScheme(scheme); + return this; + } + public TradeParty addGlobalID(SchemedID schemedID) { globalId = schemedID; return this; diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java index e527021e..f57c9520 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java @@ -414,10 +414,12 @@ public class DeSerializationTest extends ResourceCase { String number = "123"; String priceStr = "1.00"; String taxID = "9990815"; + BigDecimal price = new BigDecimal(priceStr); Invoice newInvoiceFromJSON = null; boolean hasExceptions = false; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String json = ""; try { SchemedID gtin = new SchemedID("0160", "2001015001325"); SchemedID gln = new SchemedID("0088", "4304171000002"); @@ -435,7 +437,7 @@ public class DeSerializationTest extends ResourceCase { .addCashDiscount(new CashDiscount(new BigDecimal(2), 14)) .setDeliveryDate(sdf.parse("2020-11-02")).setNumber(number).setVATDueDateTypeCode(EventTimeCodeTypeConstants.PAYMENT_DATE); ObjectMapper mapper = new ObjectMapper(); - String json = mapper.writeValueAsString(i); + json = mapper.writeValueAsString(i); newInvoiceFromJSON = mapper.readValue(json, Invoice.class); } catch (ParseException e) { hasExceptions = true; @@ -447,6 +449,23 @@ public class DeSerializationTest extends ResourceCase { } + public void testFromJSON() throws JsonProcessingException { + String globalID = "4000001123452"; + String globalIDScheme = "0088"; + String itemDeliveryFrom="2022-01-28T23:00:00.000+00:00"; + String itemDeliveryTo="2022-01-30T23:00:00.000+00:00"; + + String json="{\"number\":\"123\",\"buyerOrderReferencedDocumentID\":\"28934\",\"currency\":\"CHF\",\"issueDate\":1752744199178,\"dueDate\":1752744199178,\"deliveryDate\":1604271600000,\"sender\":{\"name\":\"Test company\",\"zip\":\"55232\",\"street\":\"teststr\",\"location\":\"teststadt\",\"country\":\"DE\",\"taxID\":\"9990815\",\"vatID\":\"DE0815\",\"id\":\"0009845\",\"globalID\":\""+globalID+"\",\"globalIDScheme\":\""+globalIDScheme+"\",\"email\":\"sender@test.org\",\"vatid\":\"DE0815\"},\"recipient\":{\"name\":\"Franz Müller\",\"zip\":\"55232\",\"street\":\"teststr.12\",\"location\":\"Entenhausen\",\"country\":\"DE\",\"vatID\":\"DE4711\",\"additionalAddress\":\"Hinterhaus 3\",\"contact\":{\"name\":\"Franz Müller\",\"phone\":\"01779999999\",\"email\":\"franz@mueller.de\",\"zip\":\"55232\",\"street\":\"teststr. 12\",\"location\":\"Entenhausen\",\"country\":\"DE\",\"fax\":\"++49555123456\"},\"globalID\":\"4304171000002\",\"globalIDScheme\":\"0088\",\"email\":\"recipient@test.org\",\"vatid\":\"DE4711\"},\"deliveryAddress\":{\"name\":\"just the other side of the street\",\"zip\":\"55232\",\"street\":\"teststr.12a\",\"location\":\"Entenhausen\",\"country\":\"DE\",\"vatID\":\"DE47110\",\"vatid\":\"DE47110\"},\"cashDiscounts\":[{\"percent\":2,\"days\":14}],\"notes\":[\"document level 1/2\",\"document level 2/2\"],\"sellerOrderReferencedDocumentID\":\"9384\",\"contractReferencedDocument\":\"376zreurzu0983\",\"valid\":true,\"vatdueDateTypeCode\":\"72\",\"zfitems\":[{\"price\":1.00,\"quantity\":1,\"basisQuantity\":1,\"detailedDeliveryPeriodFrom\":\""+itemDeliveryFrom+"\",\"detailedDeliveryPeriodTo\":\""+itemDeliveryTo+"\",\"id\":\"a123\",\"buyerOrderReferencedDocumentLineID\":\"xxx\",\"product\":{\"unit\":\"H87\",\"name\":\"Testprodukt\",\"sellerAssignedID\":\"4711\",\"taxCategoryCode\":\"S\",\"globalID\":\"2001015001325\",\"globalIDScheme\":\"0160\",\"intraCommunitySupply\":false,\"reverseCharge\":false,\"vatpercent\":16},\"notes\":[\"item level 1/1\"],\"notesWithSubjectCode\":[{\"content\":\"item level 1/1\"}],\"itemAllowances\":[{\"totalAmount\":0.0200000000000000004163336342344337026588618755340576171875,\"taxPercent\":16,\"reason\":\"item discount\",\"categoryCode\":\"S\"}],\"value\":1.00}],\"ownVATID\":\"DE0815\",\"detailedDeliveryPeriodFrom\":1601503200000,\"detailedDeliveryPeriodTo\":1601848800000,\"ownTaxID\":\"9990815\",\"ownZIP\":\"55232\",\"ownLocation\":\"teststadt\",\"zfallowances\":[{\"totalAmount\":0.200000000000000011102230246251565404236316680908203125,\"taxPercent\":16,\"reason\":\"discount\",\"categoryCode\":\"S\"}],\"ownStreet\":\"teststr\",\"zfcharges\":[{\"totalAmount\":0.5,\"taxPercent\":16,\"reason\":\"quick delivery charge\",\"categoryCode\":\"S\"}],\"ownCountry\":\"DE\"}"; + + ObjectMapper mapper = new ObjectMapper(); + Invoice fromJSON = mapper.readValue(json, Invoice.class); + assertEquals(globalID, fromJSON.getSender().getGlobalID()); + assertEquals(globalIDScheme, fromJSON.getSender().getGlobalIDScheme()); + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + assertEquals("2022-01-29", sdf.format(fromJSON.getZFItems()[0].getDetailedDeliveryPeriodFrom())); + assertEquals("2022-01-31", sdf.format(fromJSON.getZFItems()[0].getDetailedDeliveryPeriodTo())); + assertEquals("sender@test.org", fromJSON.getSender().getEmail()); + } public void testDueDateRoundtrip() throws JsonProcessingException { From 0128e39353f017a2c68d87d10601f8c99dc9c87e Mon Sep 17 00:00:00 2001 From: Daniel Luckas Date: Thu, 17 Jul 2025 14:22:27 +0200 Subject: [PATCH 05/40] Close resources after usage --- .../java/org/mustangproject/validator/ResourceCase.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/validator/src/test/java/org/mustangproject/validator/ResourceCase.java b/validator/src/test/java/org/mustangproject/validator/ResourceCase.java index 621da5ef..589d72e3 100644 --- a/validator/src/test/java/org/mustangproject/validator/ResourceCase.java +++ b/validator/src/test/java/org/mustangproject/validator/ResourceCase.java @@ -17,8 +17,7 @@ public class ResourceCase extends TestCase { private static final Logger LOGGER = LoggerFactory.getLogger(ResourceCase.class.getCanonicalName()); // log output is public static File getResourceAsFile(String resourcePath) { - try { - InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath); + try(InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath)) { if (in == null) { return null; } @@ -42,8 +41,7 @@ public class ResourceCase extends TestCase { } public static byte[] getResourceAsByteArray(String resourcePath) { - try { - InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath); + try(InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(resourcePath)) { if (in == null) { return null; } From 8a1361950181f1afbe20671e5256b4423e13daa5 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 22 Jul 2025 16:28:54 +0200 Subject: [PATCH 06/40] closes #890 --- .../java/org/mustangproject/validator/XMLValidator.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/validator/src/main/java/org/mustangproject/validator/XMLValidator.java b/validator/src/main/java/org/mustangproject/validator/XMLValidator.java index ccd57b3a..a86a681b 100644 --- a/validator/src/main/java/org/mustangproject/validator/XMLValidator.java +++ b/validator/src/main/java/org/mustangproject/validator/XMLValidator.java @@ -226,13 +226,7 @@ public class XMLValidator extends Validator { isExtended = context.getProfile().contains("extended"); validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "OX_10/comfort/SCRDMCCBDACIOMessageStructure_100pD20B.xsd", 99, EPart.ox); xsltFilename = "/xslt/OX_10/comfort/SCRDMCCBDACIOMessageStructure_100pD20B_COMFORT.xslt"; - - } else if (root.getLocalName().equalsIgnoreCase("SCRDMCCBDACIOMessageStructure")) { - context.setGeneration("1"); - isOrderX = true; - validateSchema(zfXML.getBytes(StandardCharsets.UTF_8), "OX_10/comfort/SCRDMCCBDACIOMessageStructure_100pD20B.xsd", 99, EPart.ox); - xsltFilename = "/xslt/OX_10/comfort/SCRDMCCBDACIOMessageStructure_100pD20B_COMFORT.xslt"; - + } else if (root.getLocalName().equalsIgnoreCase("CrossIndustryInvoice")) { // ZUGFeRD 2.0 or Factur-X context.setGeneration("2"); From 637e8737df32dbd69144958516172ca0be1d0494 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 25 Jul 2025 15:47:44 +0200 Subject: [PATCH 07/40] updated documentation --- doc/ZUV-Architektur.graphml | 492 +-- doc/ZUV-Architektur.svg | 6109 +++++++++++++++++++++++++++--- doc/development_documentation.md | 1 - 3 files changed, 5740 insertions(+), 862 deletions(-) diff --git a/doc/ZUV-Architektur.graphml b/doc/ZUV-Architektur.graphml index f1e1e09d..cf52259e 100644 --- a/doc/ZUV-Architektur.graphml +++ b/doc/ZUV-Architektur.graphml @@ -1,6 +1,6 @@ - + @@ -13,43 +13,37 @@ - + - + - PDF+XML - - - - - - + PDF+XML - + - + - ZUGFeRD + ZUGFeRD - + - Folder 2 + Folder 2 @@ -62,73 +56,55 @@ - + - Schematron files - - - - - - + Schematron files - + - Schema files - - - - - - + Schema files - + - Codelist XMLs - - - - - - + Codelist XMLs - + - + - EN16931 + EN16931 - + - Folder 3 + Folder 3 @@ -141,57 +117,45 @@ - + - CEF Codelist Excel - - - - - - + CEF Codelist Excel - + - CEN Schematron - - - - - - + CEN Schematron - + - + - UN/CEFACT + UN/CEFACT - + - Folder 4 + Folder 4 @@ -204,16 +168,10 @@ - + - Schema files - - - - - - + Schema files @@ -222,39 +180,33 @@ - + - XML Report - - - - - - + XML Report - + - + - ZUV + ZUV - + - Folder 5 + Folder 5 @@ -267,167 +219,113 @@ - + - PH-Schematron - - - - - - + PH-Schematron - + - XML - - - - - - + XML - + - Metadata - - - - - - + Metadata - + - Metadata check - - - - - - + Metadata check - + - XSLT files - - - - - - + XSLT files - + - XSLT files - - - - - - + XSLT files - + - Additional data - - - - - - + Additional data - + - Additional data check - - - - - - + Additional data check - + - PH-Schematron - - - - - - + PH-Schematron - + - + - Mustangproject + Mustangproject - + - Folder 1 + Folder 1 @@ -440,57 +338,45 @@ - + - PDFBox - - - - - - + PDFBox - + - Mustang - - - - - - + Mustang - + - + - VeraPDF + VeraPDF - + - Folder 6 + Folder 6 @@ -503,16 +389,10 @@ - + - VeraPDF - - - - - - + VeraPDF @@ -521,74 +401,66 @@ - + - Schema check - - - - - - + Schema check - + - XSLT files - - - - - - + XSLT files - + - PH-Schematron - - - - - - + PH-Schematron + + + + + + + + + + + Intra-line calculation - - + - + - XRechnung + XRechnung - + - Folder 7 + Folder 7 @@ -599,19 +471,12 @@ - - + - Schematron - - - - - - + Schematron @@ -621,8 +486,8 @@ - - + + @@ -634,8 +499,8 @@ - - + + @@ -647,8 +512,8 @@ - - + + @@ -660,8 +525,8 @@ - - + + @@ -683,8 +548,8 @@ - - + + @@ -696,8 +561,8 @@ - - + + @@ -729,8 +594,8 @@ - - + + @@ -742,8 +607,8 @@ - - + + @@ -754,7 +619,10 @@ - + + + + @@ -764,9 +632,9 @@ - - - + + + @@ -777,11 +645,9 @@ - - - - - + + + @@ -792,9 +658,9 @@ - - - + + + @@ -805,9 +671,9 @@ - - - + + + @@ -818,9 +684,9 @@ - - - + + + @@ -831,9 +697,9 @@ - - - + + + @@ -844,9 +710,9 @@ - - - + + + @@ -858,8 +724,8 @@ - - + + @@ -871,8 +737,8 @@ - - + + @@ -884,8 +750,8 @@ - - + + @@ -896,9 +762,9 @@ - - - + + + @@ -910,8 +776,8 @@ - - + + @@ -923,8 +789,8 @@ - - + + @@ -933,13 +799,12 @@ - - + - - + + @@ -948,11 +813,13 @@ - - + - + + + + @@ -960,13 +827,12 @@ - - + - - + + @@ -975,11 +841,43 @@ - + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + diff --git a/doc/ZUV-Architektur.svg b/doc/ZUV-Architektur.svg index f3eda531..5b4bab18 100644 --- a/doc/ZUV-Architektur.svg +++ b/doc/ZUV-Architektur.svg @@ -1,1117 +1,6098 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - PDF+XML + PDF+XML - + - + - ZUGFeRD - + ZUGFeRD + - - - - - - - - - - - + + + + + + + + + + + - Schematron files + Schematron files - - - - - - - - - - - + + + + + + + + + + + - Schema files + Schema files - - - - - - - - - - - + + + + + + + + + + + - Codelist XMLs + Codelist XMLs - - + + - EN16931 - + EN16931 + - - - - - - - - - - - + + + + + + + + + + + - CEF Codelist Excel + CEF Codelist Excel - - - - - - - - - - - + + + + + + + + + + + - CEN Schematron + CEN Schematron - - + + - - + + - UN/CEFACT - + UN/CEFACT + - - - - - - - - - - - + + + + + + + + + + + - Schema files + Schema files - - - - + + + + - XML Report + XML Report - - + + - - + + - ZUV - + ZUV + - - - - - - - - - - - + + + + + + + + + + + - PH-Schematron + PH-Schematron - - - - - - - - - - - + + + + + + + + + + + - XML + XML - - - - - - - - - - - + + + + + + + + + + + - Metadata + Metadata - - - - - - - - - - - + + + + + + + + + + + - Metadata check + Metadata check - - - - - - - - - - - + + + + + + + + + + + - XSLT files + XSLT files - - - - - - - - - - - + + + + + + + + + + + - XSLT files + XSLT files - - - - - - - - - - - + + + + + + + + + + + - Additional data + Additional data - - - - - - - - - - - + + + + + + + + + + + - Additional data check + Additional data check - - - - - - - - - - - + + + + + + + + + + + - PH-Schematron + PH-Schematron - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - Mustangproject - + Mustangproject + - - - - - - - - - - - + + + + + + + + + + + - PDFBox + PDFBox - - - - - - - - - - - + + + + + + + + + + + - Mustang + Mustang - - - - - - - - - - + + + + + + + + + + - - + + - VeraPDF - + VeraPDF + - - - - - - - - - - - + + + + + + + + + + + - VeraPDF + VeraPDF - - - - - - - - - - - + + + + + + + + + + + - Schema check + Schema check - - - - - - - - - - - + + + + + + + + + + + - XSLT files + XSLT files - - - - - - - - - - - + + + + + + + + + + + - PH-Schematron + PH-Schematron + + + + + + + + + + + + + + + + + + + Intra-line calculation - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - + + - XRechnung - + XRechnung + - - - - + + + + - Schematron + Schematron - - + + diff --git a/doc/development_documentation.md b/doc/development_documentation.md index c08c457c..852a6071 100644 --- a/doc/development_documentation.md +++ b/doc/development_documentation.md @@ -184,7 +184,6 @@ maybe not yet even existing new release version: ``` cd validator/target -mvn install:install-file -Dfile=validator-2.17.0-SNAPSHOT-shaded.jar -Dclassifier=shaded -DgroupId="org.mustangproject" -DartifactId=validator -Dversion="2.17.0" -Dpackaging=jar -DgeneratePom=true ``` In gradle you can use something like ``` From 056d01bc49105f9d0b39c964afb6cb9648bca510 Mon Sep 17 00:00:00 2001 From: langfr Date: Mon, 28 Jul 2025 12:44:24 +0100 Subject: [PATCH 08/40] Use UTC as the defined timezone for tests. --- Mustang-CLI/pom.xml | 2 ++ library/pom.xml | 2 ++ .../org/mustangproject/ZUGFeRD/DeSerializationTest.java | 4 ++-- .../mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java | 4 ++-- pom.xml | 7 +++---- validator/pom.xml | 2 ++ 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index 3a2ae520..22f41162 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -106,8 +106,10 @@ org.apache.maven.plugins maven-surefire-plugin + 3.5.3 alphabetical + -Duser.timezone=UTC diff --git a/library/pom.xml b/library/pom.xml index 55bf65f5..10442661 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -179,8 +179,10 @@ org.apache.maven.plugins maven-surefire-plugin + 3.5.3 alphabetical + -Duser.timezone=UTC diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java index f57c9520..f3e68fcc 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java @@ -462,8 +462,8 @@ public class DeSerializationTest extends ResourceCase { assertEquals(globalID, fromJSON.getSender().getGlobalID()); assertEquals(globalIDScheme, fromJSON.getSender().getGlobalIDScheme()); SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); - assertEquals("2022-01-29", sdf.format(fromJSON.getZFItems()[0].getDetailedDeliveryPeriodFrom())); - assertEquals("2022-01-31", sdf.format(fromJSON.getZFItems()[0].getDetailedDeliveryPeriodTo())); + assertEquals("2022-01-28", sdf.format(fromJSON.getZFItems()[0].getDetailedDeliveryPeriodFrom())); + assertEquals("2022-01-30", sdf.format(fromJSON.getZFItems()[0].getDetailedDeliveryPeriodTo())); assertEquals("sender@test.org", fromJSON.getSender().getEmail()); } diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java index ec987111..df425725 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java @@ -407,7 +407,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { ObjectMapper mapper = new ObjectMapper(); String jsonArray = mapper.writeValueAsString(i); - JSONAssert.assertEquals("{\"documentCode\":\"380\",\"number\":\"471102\",\"currency\":\"EUR\",\"paymentTermDescription\":\"Der Betrag in Höhe von EUR 529,87 wird am 20.03.2018 von Ihrem Konto per SEPA-Lastschrift eingezogen.\\n \",\"issueDate\":1520118000000,\"deliveryDate\":1520118000000,\"sender\":{\"name\":\"Lieferant GmbH\",\"zip\":\"80333\",\"street\":\"Lieferantenstraße 20\",\"location\":\"München\",\"country\":\"DE\",\"taxID\":\"201/113/40209\",\"vatID\":\"DE123456789\",\"debitDetails\":[{\"mandate\":\"REF A-123\",\"paymentMeansCode\":\"59\",\"paymentMeansInformation\":\"SEPA direct debit\",\"iban\":\"DE21860000000086001055\"}],\"vatid\":\"DE123456789\"},\"recipient\":{\"name\":\"Kunden AG Mitte\",\"zip\":\"69876\",\"street\":\"Kundenstraße 15\",\"location\":\"Frankfurt\",\"country\":\"DE\",\"bankDetails\":[{\"paymentMeansCode\":\"58\",\"paymentMeansInformation\":\"SEPA credit transfer\",\"iban\":\"DE21860000000086001055\"}]},\"totalPrepaidAmount\":0.00,\"creditorReferenceID\":\"DE98ZZZ09999999999\",\"valid\":false,\"zfitems\":[{\"price\":9.9000,\"quantity\":20.0000,\"basisQuantity\":1.0000,\"id\":\"1\",\"product\":{\"unit\":\"H87\",\"name\":\"Trennblätter A4\",\"taxCategoryCode\":\"S\",\"vatpercent\":19.00,\"reverseCharge\":false,\"intraCommunitySupply\":false},\"value\":9.9000},{\"price\":5.5000,\"quantity\":50.0000,\"basisQuantity\":1.0000,\"id\":\"2\",\"product\":{\"unit\":\"H87\",\"name\":\"Joghurt Banane\",\"taxCategoryCode\":\"S\",\"vatpercent\":7.00,\"reverseCharge\":false,\"intraCommunitySupply\":false},\"value\":5.5000}],\"tradeSettlement\":[{\"mandate\":\"REF A-123\",\"paymentMeansCode\":\"59\",\"paymentMeansInformation\":\"SEPA direct debit\",\"iban\":\"DE21860000000086001055\"}],\"ownTaxID\":\"201/113/40209\",\"ownZIP\":\"80333\",\"ownCountry\":\"DE\",\"ownVATID\":\"DE123456789\",\"ownLocation\":\"München\",\"ownStreet\":\"Lieferantenstraße 20\"}",jsonArray,false); + JSONAssert.assertEquals("{\"documentCode\":\"380\",\"number\":\"471102\",\"currency\":\"EUR\",\"paymentTermDescription\":\"Der Betrag in Höhe von EUR 529,87 wird am 20.03.2018 von Ihrem Konto per SEPA-Lastschrift eingezogen.\\n \",\"issueDate\":1520121600000,\"deliveryDate\":1520121600000,\"sender\":{\"name\":\"Lieferant GmbH\",\"zip\":\"80333\",\"street\":\"Lieferantenstraße 20\",\"location\":\"München\",\"country\":\"DE\",\"taxID\":\"201/113/40209\",\"vatID\":\"DE123456789\",\"debitDetails\":[{\"mandate\":\"REF A-123\",\"paymentMeansCode\":\"59\",\"paymentMeansInformation\":\"SEPA direct debit\",\"iban\":\"DE21860000000086001055\"}],\"vatid\":\"DE123456789\"},\"recipient\":{\"name\":\"Kunden AG Mitte\",\"zip\":\"69876\",\"street\":\"Kundenstraße 15\",\"location\":\"Frankfurt\",\"country\":\"DE\",\"bankDetails\":[{\"paymentMeansCode\":\"58\",\"paymentMeansInformation\":\"SEPA credit transfer\",\"iban\":\"DE21860000000086001055\"}]},\"totalPrepaidAmount\":0.00,\"creditorReferenceID\":\"DE98ZZZ09999999999\",\"valid\":false,\"zfitems\":[{\"price\":9.9000,\"quantity\":20.0000,\"basisQuantity\":1.0000,\"id\":\"1\",\"product\":{\"unit\":\"H87\",\"name\":\"Trennblätter A4\",\"taxCategoryCode\":\"S\",\"vatpercent\":19.00,\"reverseCharge\":false,\"intraCommunitySupply\":false},\"value\":9.9000},{\"price\":5.5000,\"quantity\":50.0000,\"basisQuantity\":1.0000,\"id\":\"2\",\"product\":{\"unit\":\"H87\",\"name\":\"Joghurt Banane\",\"taxCategoryCode\":\"S\",\"vatpercent\":7.00,\"reverseCharge\":false,\"intraCommunitySupply\":false},\"value\":5.5000}],\"tradeSettlement\":[{\"mandate\":\"REF A-123\",\"paymentMeansCode\":\"59\",\"paymentMeansInformation\":\"SEPA direct debit\",\"iban\":\"DE21860000000086001055\"}],\"ownTaxID\":\"201/113/40209\",\"ownZIP\":\"80333\",\"ownCountry\":\"DE\",\"ownVATID\":\"DE123456789\",\"ownLocation\":\"München\",\"ownStreet\":\"Lieferantenstraße 20\"}",jsonArray,false); } catch (IOException e) { fail("IOException not expected"); @@ -418,7 +418,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { } } public static Date atStartOfDay(Date date) { - ZoneId tz=ZoneId.ofOffset("GMT", ZoneOffset.ofHours(+2)); + ZoneId tz=ZoneId.ofOffset("UTC", ZoneOffset.ofHours(0)); LocalDateTime localDateTime = LocalDateTime.ofInstant(date.toInstant(), tz); LocalDateTime startOfDay = localDateTime.with(LocalTime.MIN); return Date.from(startOfDay.atZone(tz).toInstant()); diff --git a/pom.xml b/pom.xml index 52b863b8..b5c94c61 100644 --- a/pom.xml +++ b/pom.xml @@ -81,17 +81,16 @@ org.apache.maven.plugins maven-surefire-plugin + 3.5.3 alphabetical + -Duser.timezone=UTC org.apache.maven.plugins maven-source-plugin - 3.2.1 - - UTF-8 - + 3.3.1 attach-javadoc diff --git a/validator/pom.xml b/validator/pom.xml index f5b5281a..57866cba 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -129,8 +129,10 @@ org.apache.maven.plugins maven-surefire-plugin + 3.5.3 alphabetical + -Duser.timezone=UTC From 5555db58aa6e3a0aaac499571d3996fd35aafac4 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 29 Jul 2025 11:15:28 +0200 Subject: [PATCH 09/40] also read/import product discounts --- doc/development_documentation.md | 18 ++- .../main/java/org/mustangproject/Item.java | 49 ++++-- .../main/java/org/mustangproject/Product.java | 18 +++ .../ZUGFeRD/CalculationTest.java | 18 +-- .../ZUGFeRD/DeSerializationTest.java | 13 +- .../mustangproject/ZUGFeRD/ZF2PushTest.java | 144 +++++++++++++----- .../ZUGFeRD/ZF2ZInvoiceImporterTest.java | 2 +- 7 files changed, 199 insertions(+), 63 deletions(-) diff --git a/doc/development_documentation.md b/doc/development_documentation.md index 852a6071..e940ebda 100644 --- a/doc/development_documentation.md +++ b/doc/development_documentation.md @@ -57,12 +57,26 @@ to validate the XML part of the invoices. ![Architecture of the validator](ZUV-Architektur.svg "Graph of the architecture of the validator component") -## New build +## Aspects +Apart from the fact that apart from +* the code +* we need tests and apart from implementing it in -Target platform is java 1.17 +* the interface +* usually we need functionality in or via the invoice class. + +Reading should work for both +* CII and +* UBL + +And when writing, +* it should be readable as well, usually in the invoiceimporter, +* and it should be readable and writeable via Jackson (i.e. JSON) ## Build +Target platform is java 1.17 + The package can be build with ``` mvnw clean package diff --git a/library/src/main/java/org/mustangproject/Item.java b/library/src/main/java/org/mustangproject/Item.java index c062e620..d2add5d7 100644 --- a/library/src/main/java/org/mustangproject/Item.java +++ b/library/src/main/java/org/mustangproject/Item.java @@ -120,10 +120,14 @@ public class Item implements IZUGFeRDExportableItem { itemMap.getAsString("ID") .ifPresent(this::setId); - itemMap.getAsString("Note") .ifPresent(this::addNote); + if (itemMap.getNode("SpecifiedTradeProduct").isPresent()) { + product = new Product(itemMap.getNode("SpecifiedTradeProduct").get()); + } else { + product = new Product(); + } itemMap.getAsNodeMap("SpecifiedLineTradeAgreement", "SpecifiedSupplyChainTradeAgreement").ifPresent(icnm -> { icnm.getAsNodeMap("BuyerOrderReferencedDocument") @@ -138,14 +142,39 @@ public class Item implements IZUGFeRDExportableItem { npptpNodes.getAsBigDecimal("ChargeAmount").ifPresent(this::setPrice); npptpNodes.getAsBigDecimal("BasisQuantity").ifPresent(this::setBasisQuantity); }); + icnm.getAsNodeMap("GrossPriceProductTradePrice").ifPresent(gpptpNodes -> { + gpptpNodes.getAsNodeMap("AppliedTradeAllowanceCharge").ifPresent(gpptpAtacNodes -> { + + /** mustang attributes differences between net and gross price to the product */ + String chargeIndicator = gpptpAtacNodes.getAsStringOrNull("ChargeIndicator"); + if ((chargeIndicator != null)&&(gpptpAtacNodes.getAsBigDecimal("ActualAmount").isPresent())) { + BigDecimal actual = gpptpAtacNodes.getAsBigDecimal("ActualAmount").get(); + if (chargeIndicator.equals("true")) { + product.addCharge(new Charge(actual)); + setPrice(getPrice().subtract(actual)); // the gross price affects the net price, which is read, + // so if we do not ignore charges|allowances we have to re-compensate the net price + } else { + product.addAllowance(new Allowance(actual)); + setPrice(getPrice().add(actual)); + } + + } + }); + }); + + + /* + String chargeIndicator = gpptpNodes.getAsNodeMap("AppliedTradeAllowanceCharge").flatMap(acChargeIndicatorNodes -> acChargeIndicatorNodes.getAsString("ChargeIndicator")).get(); + if (chargeIndicator != null) { + BigDecimal actual = gpptpNodes.getAsNodeMap("AppliedTradeAllowanceCharge").flatMap(acChargeIndicatorNodes -> acChargeIndicatorNodes.getAsBigDecimal("ActualAmount")).get(); + if (actual != null) { + } + }*/ icnm.getAllNodes("AdditionalReferencedDocument").map(ReferencedDocument::fromNode). forEach(this::addReferencedDocument); }); - itemMap.getNode("SpecifiedTradeProduct").map(Product::new).ifPresent(this::setProduct);//CII - itemMap.getNode("SpecifiedTradeProduct").map(Product::new).ifPresent(this::setProduct);//UBL - // RequestedQuantity is for Order-X, BilledQuantity for FX and ZF itemMap.getAsNodeMap("SpecifiedLineTradeDelivery", "SpecifiedSupplyChainTradeDelivery") .flatMap(icnm -> icnm.getNode("BilledQuantity", "RequestedQuantity", "DespatchedQuantity")) @@ -182,7 +211,7 @@ public class Item implements IZUGFeRDExportableItem { } if (amountString != null) { izac.setTotalAmount(new BigDecimal(amountString)); - if (percentString!=null&&(!percentString.equals("0"))) { + if (percentString != null && (!percentString.equals("0"))) { izac.setTotalAmount(new BigDecimal(amountString).divide(getQuantity())); } } @@ -304,14 +333,16 @@ public class Item implements IZUGFeRDExportableItem { } @JsonIgnore - @Override public IZUGFeRDAllowanceCharge[] getAllowances() { // in JSON is already returned as itemAllowances (and only read from there) - IZUGFeRDAllowanceCharge[] izac=new IZUGFeRDAllowanceCharge[Allowances.size()]; + @Override + public IZUGFeRDAllowanceCharge[] getAllowances() { // in JSON is already returned as itemAllowances (and only read from there) + IZUGFeRDAllowanceCharge[] izac = new IZUGFeRDAllowanceCharge[Allowances.size()]; return Allowances.toArray(izac); } @JsonIgnore - @Override public IZUGFeRDAllowanceCharge[] getCharges() { // in JSON is already returned as itemAllowances (and only read from there) - IZUGFeRDAllowanceCharge[] izac=new IZUGFeRDAllowanceCharge[Charges.size()]; + @Override + public IZUGFeRDAllowanceCharge[] getCharges() { // in JSON is already returned as itemAllowances (and only read from there) + IZUGFeRDAllowanceCharge[] izac = new IZUGFeRDAllowanceCharge[Charges.size()]; return Charges.toArray(izac); } diff --git a/library/src/main/java/org/mustangproject/Product.java b/library/src/main/java/org/mustangproject/Product.java index 93e48a79..c394b7a4 100644 --- a/library/src/main/java/org/mustangproject/Product.java +++ b/library/src/main/java/org/mustangproject/Product.java @@ -406,6 +406,16 @@ public class Product implements IZUGFeRDExportableProduct { return this; } + + /*** + * Jackson courtesy function, please use addCharge if you have the choice + * @return array of or null, if none + */ + public Product setCharges(ArrayList charges) { + this.charges=charges; + return this; + } + /*** * returns the AppliedTradeAllowanceCharges of this product which are actually Charges * @return array of or null, if none @@ -432,5 +442,13 @@ public class Product implements IZUGFeRDExportableProduct { return allowances.toArray(allowanceArr); } + /*** + * Jackson courtesy function, please use addAllowance if you have the choice + * @return array of or null, if none + */ + public Product setAllowances(ArrayList allowances) { + this.allowances=allowances; + return this; + } } diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/CalculationTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/CalculationTest.java index ebdcf643..f386d655 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/CalculationTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/CalculationTest.java @@ -106,14 +106,14 @@ public class CalculationTest extends ResourceCase { Product product; Item item; - product = new Product("Pens", "", "H84", new BigDecimal(25)); + product = new Product("Pens", "", "H87", new BigDecimal(25)); product.addAllowance(new Allowance(new BigDecimal(1))); item = new Item(product, new BigDecimal("9.50"), new BigDecimal(25)); item.addCharge(new Charge(new BigDecimal(10)).setReasonCode("ZZZ").setReason("Zuschlag")); LineCalculator lc = new LineCalculator(item); assertEquals(new BigDecimal("222.50"), lc.getItemTotalNetAmount()); invoice.addItem(item); - product = new Product("Paper", "", "H84", new BigDecimal(25)); + product = new Product("Paper", "", "H87", new BigDecimal(25)); item = new Item(product, new BigDecimal("4.50"), new BigDecimal(15)); item.addAllowance(new Allowance().setPercent(new BigDecimal(5)).setReasonCode("ZZZ").setReason("Zuschlag")); lc = new LineCalculator(item); @@ -201,7 +201,7 @@ public class CalculationTest extends ResourceCase { Product product; Item item; - product = new Product("AAA", "", "H84", sales_tax_percent1).setSellerAssignedID("1AAA"); + product = new Product("AAA", "", "H87", sales_tax_percent1).setSellerAssignedID("1AAA"); item = new Item(product, new BigDecimal("4.750"), new BigDecimal(5.00)); // set values for additional charge and discount used for next lines @@ -218,19 +218,19 @@ public class CalculationTest extends ResourceCase { invoice.addItem(item); - product = new Product("BBB", "", "H84", sales_tax_percent1).setSellerAssignedID("2BBB"); + product = new Product("BBB", "", "H87", sales_tax_percent1).setSellerAssignedID("2BBB"); item = new Item(product, new BigDecimal("5.750"), new BigDecimal(4.00)); invoice.addItem(item); - product = new Product("CCC", "", "H84", sales_tax_percent1).setSellerAssignedID("3CCC"); + product = new Product("CCC", "", "H87", sales_tax_percent1).setSellerAssignedID("3CCC"); item = new Item(product, new BigDecimal("6.750"), new BigDecimal(3.00)); invoice.addItem(item); - product = new Product("DDD", "", "H84", sales_tax_percent1).setSellerAssignedID("4DDD"); + product = new Product("DDD", "", "H87", sales_tax_percent1).setSellerAssignedID("4DDD"); item = new Item(product, new BigDecimal("7.750"), new BigDecimal(2.00)); invoice.addItem(item); - product = new Product("EEE", "", "H84", sales_tax_percent1).setSellerAssignedID("5EEE"); + product = new Product("EEE", "", "H87", sales_tax_percent1).setSellerAssignedID("5EEE"); item = new Item(product, new BigDecimal("8.750"), new BigDecimal(1.00)); invoice.addItem(item); @@ -277,7 +277,7 @@ public class CalculationTest extends ResourceCase { Product product; Item item; - product = new Product("AAA", "", "H84", BigDecimal.ZERO); + product = new Product("AAA", "", "H87", BigDecimal.ZERO); item = new Item(product, new BigDecimal("1.10"), new BigDecimal(5.00)); item.addAllowance(new Allowance().setPercent(new BigDecimal(10)).setTaxPercent(BigDecimal.ZERO)); @@ -369,7 +369,7 @@ public class CalculationTest extends ResourceCase { Product product; Item item; - product = new Product("AAA", "", "H84", BigDecimal.ZERO); + product = new Product("AAA", "", "H87", BigDecimal.ZERO); item = new Item(product, new BigDecimal("1.00"), new BigDecimal(5.00)); item.addAllowance(new Allowance(new BigDecimal(1)).setTaxPercent(BigDecimal.ZERO)); diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java index f57c9520..c0ac9f3a 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/DeSerializationTest.java @@ -446,9 +446,8 @@ public class DeSerializationTest extends ResourceCase { } assertEquals(newInvoiceFromJSON.getBuyerOrderReferencedDocumentID(), "28934"); assertFalse(hasExceptions); - - } + public void testFromJSON() throws JsonProcessingException { String globalID = "4000001123452"; String globalIDScheme = "0088"; @@ -467,6 +466,16 @@ public class DeSerializationTest extends ResourceCase { assertEquals("sender@test.org", fromJSON.getSender().getEmail()); } + public void testGrossFromJSON() throws JsonProcessingException { + + String json="{ \"documentCode\": \"380\", \"number\": \"123\", \"currency\": \"EUR\", \"paymentTermDescription\": \"Please remit until 28.07.2025\", \"issueDate\": 1753653600000, \"dueDate\": 1753653600000, \"sender\": { \"name\": \"Test company\", \"zip\": \"55232\", \"street\": \"teststr\", \"location\": \"teststadt\", \"country\": \"DE\", \"taxID\": \"4711\", \"vatID\": \"DE0815\", \"vatid\": \"DE0815\" }, \"recipient\": { \"name\": \"Franz Müller\", \"zip\": \"55232\", \"street\": \"teststr.12\", \"location\": \"Entenhausen\", \"country\": \"DE\", \"contact\": { \"name\": \"contact testname\", \"phone\": \"123456\", \"email\": \"contact.testemail@example.org\", \"fax\": \"0911623562\" } }, \"totalPrepaidAmount\": 0.00, \"lineTotalAmount\": 29.00, \"duePayable\": 34.51, \"grandTotal\": 34.51, \"taxBasis\": 29.00, \"valid\": true, \"zfitems\": [ { \"price\": 3.0000, \"quantity\": 10.0000, \"basisQuantity\": 1.0000, \"id\": \"1\", \"product\": { \"unit\": \"H87\", \"name\": \"Testprodukt\", \"taxCategoryCode\": \"S\", \"allowances\": [ { \"totalAmount\": 0.1000, \"categoryCode\": \"S\" } ], \"vatpercent\": 19.00, \"intraCommunitySupply\": false, \"reverseCharge\": false }, \"value\": 3.0000 } ], \"ownVATID\": \"DE0815\", \"ownTaxID\": \"4711\", \"ownLocation\": \"teststadt\", \"ownZIP\": \"55232\", \"ownCountry\": \"DE\", \"ownStreet\": \"teststr\"}"; + + ObjectMapper mapper = new ObjectMapper(); + CalculatedInvoice fromJSON = mapper.readValue(json, CalculatedInvoice.class); + fromJSON.calculate(); + assertEquals(new BigDecimal("34.51"),fromJSON.getDuePayable()); + } + public void testDueDateRoundtrip() throws JsonProcessingException { ObjectMapper mapper = new ObjectMapper(); diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java index a72a7953..9ad9cd53 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java @@ -53,6 +53,7 @@ public class ZF2PushTest extends TestCase { final String TARGET_ALLOWANCESPDF = "./target/testout-ZF2PushAllowances.pdf"; final String TARGET_CREDITNOTEPDF = "./target/testout-ZF2PushCreditNote.pdf"; final String TARGET_CORRECTIONPDF = "./target/testout-ZF2PushCorrection.pdf"; + final String TARGET_ITEMGROSS = "./target/testout-ZF2PushGross.pdf"; final String TARGET_ITEMCHARGESALLOWANCESPDF = "./target/testout-ZF2PushItemChargesAllowances.pdf"; final String TARGET_CHARGESALLOWANCESPDF = "./target/testout-ZF2PushChargesAllowances.pdf"; final String TARGET_RELATIVECHARGESALLOWANCESPDF = "./target/testout-ZF2PushRelativeChargesAllowances.pdf"; @@ -159,7 +160,7 @@ public class ZF2PushTest extends TestCase { .setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addVATID("DE4711") .setContact(new Contact("Franz Müller", "01779999999", "franz@mueller.de", "teststr. 12", "55232", "Entenhausen", "DE"))) .setNumber(number) - .addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)).setTaxExemptionReason("Kleinunternehmer gemäß §19 UStG").setTaxCategoryCode("E"), price, new BigDecimal(1.0)).addNote(theNote)) + .addItem(new Item(new Product("Testprodukt", "", "H87", new BigDecimal(0)).setTaxExemptionReason("Kleinunternehmer gemäß §19 UStG").setTaxCategoryCode("E"), price, new BigDecimal(1.0)).addNote(theNote)) ); String theXML = new String(ze.getProvider().getXML()); assertTrue(theXML.contains(" Date: Wed, 30 Jul 2025 10:18:13 +0200 Subject: [PATCH 10/40] corrected UBL behaviour (ignorance) --- .../main/java/org/mustangproject/Item.java | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/library/src/main/java/org/mustangproject/Item.java b/library/src/main/java/org/mustangproject/Item.java index d2add5d7..b8afa6be 100644 --- a/library/src/main/java/org/mustangproject/Item.java +++ b/library/src/main/java/org/mustangproject/Item.java @@ -123,10 +123,12 @@ public class Item implements IZUGFeRDExportableItem { itemMap.getAsString("Note") .ifPresent(this::addNote); - if (itemMap.getNode("SpecifiedTradeProduct").isPresent()) { - product = new Product(itemMap.getNode("SpecifiedTradeProduct").get()); - } else { - product = new Product(); + if (product==null) { // CII + if (itemMap.getNode("SpecifiedTradeProduct").isPresent()) { + product = new Product(itemMap.getNode("SpecifiedTradeProduct").get()); + } else { + product = new Product(); + } } itemMap.getAsNodeMap("SpecifiedLineTradeAgreement", "SpecifiedSupplyChainTradeAgreement").ifPresent(icnm -> { @@ -161,16 +163,6 @@ public class Item implements IZUGFeRDExportableItem { } }); }); - - - /* - String chargeIndicator = gpptpNodes.getAsNodeMap("AppliedTradeAllowanceCharge").flatMap(acChargeIndicatorNodes -> acChargeIndicatorNodes.getAsString("ChargeIndicator")).get(); - if (chargeIndicator != null) { - BigDecimal actual = gpptpNodes.getAsNodeMap("AppliedTradeAllowanceCharge").flatMap(acChargeIndicatorNodes -> acChargeIndicatorNodes.getAsBigDecimal("ActualAmount")).get(); - if (actual != null) { - } - }*/ - icnm.getAllNodes("AdditionalReferencedDocument").map(ReferencedDocument::fromNode). forEach(this::addReferencedDocument); }); @@ -250,7 +242,7 @@ public class Item implements IZUGFeRDExportableItem { }); }); - itemMap.getAllNodes("AllowanceCharge").map(NodeMap::new).forEach(stac -> { //UBL + itemMap.getAllNodes("AllowanceCharge").map(NodeMap::new).forEach(stac -> { //CII String isChargeString = stac.getAsString("ChargeIndicator").get(); String percentString = stac.getAsStringOrNull("MultiplierFactorNumeric"); From 051ad358ec66560584cb4b1316a7f6faf329aecd Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 16:51:00 +0200 Subject: [PATCH 11/40] 2nd 2.18.1 prerelease --- History.md | 4 ++++ Mustang-CLI/pom.xml | 2 +- library/pom.xml | 2 +- pom.xml | 14 +++++++------- validator/pom.xml | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/History.md b/History.md index 256e7c9f..85ad4e39 100644 --- a/History.md +++ b/History.md @@ -1,6 +1,10 @@ 2.18.1 ======= - #893 Tradeparty globalID is not read from JSON +- #902 Tests to use definted TZ (UTC) +- #905 Parse product level charges/discounts in UBL +- 869 +- 861 2.18.0 ======= diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index 22f41162..dba7846f 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.1.2 4.0.0 org.mustangproject diff --git a/library/pom.xml b/library/pom.xml index 10442661..ad68ab07 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.mustangproject library - 2.18.1-SNAPSHOT + 2.18.1.2 jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT diff --git a/pom.xml b/pom.xml index b5c94c61..8d5a4dff 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1-SNAPSHOT pom + 2.18.1.2 pom Mustang @@ -102,14 +102,14 @@ - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + gitlab-maven + https://dev.usegroup.de/api/v4/projects/63/packages/maven + + gitlab-maven + https://dev.usegroup.de/api/v4/projects/63/packages/maven + UTF-8 diff --git a/validator/pom.xml b/validator/pom.xml index 57866cba..711313c8 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.1.2 4.0.0 org.mustangproject From 73124ced31b901a0c355c1876356e006bc5a49f8 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 16:59:30 +0200 Subject: [PATCH 12/40] [maven-release-plugin] prepare release core-2.18.0.2 --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index dba7846f..df6359ee 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1.2 + 2.18.0.2 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.1-SNAPSHOT + 2.18.0.2 UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.1-SNAPSHOT + 2.18.0.2 diff --git a/library/pom.xml b/library/pom.xml index ad68ab07..6279eff7 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.0.2 4.0.0 org.mustangproject library - 2.18.1.2 + 2.18.0.2 jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.3.2 + core-2.18.0.2 diff --git a/pom.xml b/pom.xml index 8d5a4dff..ccba5d1b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1.2 pom + 2.18.0.2 pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.3.2 + core-2.18.0.2 diff --git a/validator/pom.xml b/validator/pom.xml index 711313c8..130d92c9 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1.2 + 2.18.0.2 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.1-SNAPSHOT + 2.18.0.2 From 29258d3fe1c506be800397e30a6ff86c803cc196 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 16:59:37 +0200 Subject: [PATCH 13/40] [maven-release-plugin] prepare for next development iteration --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index df6359ee..22f41162 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.0.2 + 2.18.1-SNAPSHOT UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.0.2 + 2.18.1-SNAPSHOT diff --git a/library/pom.xml b/library/pom.xml index 6279eff7..10442661 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject library - 2.18.0.2 + 2.18.1-SNAPSHOT jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.18.0.2 + core-2.3.2 diff --git a/pom.xml b/pom.xml index ccba5d1b..50c00fe3 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.0.2 pom + 2.18.1-SNAPSHOT pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.18.0.2 + core-2.3.2 diff --git a/validator/pom.xml b/validator/pom.xml index 130d92c9..57866cba 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.0.2 + 2.18.1-SNAPSHOT From 4dd528044ae3a027001aa2bd10c4fe9875cd7d8a Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 17:03:48 +0200 Subject: [PATCH 14/40] [maven-release-plugin] rollback the release of core-2.18.0.2 --- Mustang-CLI/pom.xml | 2 +- library/pom.xml | 2 +- pom.xml | 2 +- validator/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index 22f41162..dba7846f 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.1.2 4.0.0 org.mustangproject diff --git a/library/pom.xml b/library/pom.xml index 10442661..ad68ab07 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.mustangproject library - 2.18.1-SNAPSHOT + 2.18.1.2 jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT diff --git a/pom.xml b/pom.xml index 50c00fe3..8d5a4dff 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1-SNAPSHOT pom + 2.18.1.2 pom Mustang diff --git a/validator/pom.xml b/validator/pom.xml index 57866cba..711313c8 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.1.2 4.0.0 org.mustangproject From c393ed685a8729efe995a9d04a93453a5dd355b3 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 17:06:05 +0200 Subject: [PATCH 15/40] updating release target --- library/pom.xml | 12 ------------ pom.xml | 11 ----------- validator/pom.xml | 13 ------------- 3 files changed, 36 deletions(-) diff --git a/library/pom.xml b/library/pom.xml index ad68ab07..0d7dcd44 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -22,18 +22,6 @@ https://github.com/ZUGFeRD/mustangproject core-2.3.2 - - - sonatype-oss-public - https://oss.sonatype.org/content/groups/public/ - - true - - - true - - - internal.repo diff --git a/pom.xml b/pom.xml index 8d5a4dff..57bbcc93 100644 --- a/pom.xml +++ b/pom.xml @@ -67,17 +67,6 @@ - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.7.0 - true - - ossrh - https://ossrh-staging-api.central.sonatype.com/ - true - - org.apache.maven.plugins maven-surefire-plugin diff --git a/validator/pom.xml b/validator/pom.xml index 711313c8..40ecbe39 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -12,19 +12,6 @@ jar 2.18.1-SNAPSHOT - - - - sonatype-oss-public - https://oss.sonatype.org/content/groups/public/ - - true - - - true - - - UTF-8 false From 67fef919f8c2a36dd358388743a8f11f721d2a30 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 17:16:01 +0200 Subject: [PATCH 16/40] [maven-release-plugin] prepare release core-2.18.0.2 --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index dba7846f..df6359ee 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1.2 + 2.18.0.2 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.1-SNAPSHOT + 2.18.0.2 UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.1-SNAPSHOT + 2.18.0.2 diff --git a/library/pom.xml b/library/pom.xml index 0d7dcd44..fc702254 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.0.2 4.0.0 org.mustangproject library - 2.18.1.2 + 2.18.0.2 jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.3.2 + core-2.18.0.2 diff --git a/pom.xml b/pom.xml index 57bbcc93..746f42c4 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1.2 pom + 2.18.0.2 pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.3.2 + core-2.18.0.2 diff --git a/validator/pom.xml b/validator/pom.xml index 40ecbe39..2d493d53 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1.2 + 2.18.0.2 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.1-SNAPSHOT + 2.18.0.2 UTF-8 false From 304a1cea70544521f1869d3d1d5dc1c1646f3d6b Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 17:17:41 +0200 Subject: [PATCH 17/40] [maven-release-plugin] prepare for next development iteration --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index df6359ee..22f41162 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.0.2 + 2.18.1-SNAPSHOT UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.0.2 + 2.18.1-SNAPSHOT diff --git a/library/pom.xml b/library/pom.xml index fc702254..ab2d01f8 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject library - 2.18.0.2 + 2.18.1-SNAPSHOT jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.18.0.2 + core-2.3.2 diff --git a/pom.xml b/pom.xml index 746f42c4..4997578b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.0.2 pom + 2.18.1-SNAPSHOT pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.18.0.2 + core-2.3.2 diff --git a/validator/pom.xml b/validator/pom.xml index 2d493d53..f27218b7 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.0.2 + 2.18.1-SNAPSHOT UTF-8 false From 587e310e6aacc72cd6b3c269f4ce7dbcc5d72277 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 17:41:50 +0200 Subject: [PATCH 18/40] [maven-release-plugin] rollback the release of core-2.18.0.2 --- Mustang-CLI/pom.xml | 2 +- library/pom.xml | 2 +- pom.xml | 2 +- validator/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index 22f41162..dba7846f 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.1.2 4.0.0 org.mustangproject diff --git a/library/pom.xml b/library/pom.xml index ab2d01f8..0d7dcd44 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.mustangproject library - 2.18.1-SNAPSHOT + 2.18.1.2 jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT diff --git a/pom.xml b/pom.xml index 4997578b..57bbcc93 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1-SNAPSHOT pom + 2.18.1.2 pom Mustang diff --git a/validator/pom.xml b/validator/pom.xml index f27218b7..40ecbe39 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.1.2 4.0.0 org.mustangproject From cb32b69092ec7e1a17c2cc8a0903a8094c7d0125 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 17:55:17 +0200 Subject: [PATCH 19/40] [maven-release-plugin] prepare release core-2.18.1-S2 --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index dba7846f..dd380d7a 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1.2 + 2.18.1-S2 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.1-SNAPSHOT + 2.18.1-S2 UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.1-SNAPSHOT + 2.18.1-S2 diff --git a/library/pom.xml b/library/pom.xml index 0d7dcd44..fa3530f0 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.1-S2 4.0.0 org.mustangproject library - 2.18.1.2 + 2.18.1-S2 jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.3.2 + core-2.18.1-S2 diff --git a/pom.xml b/pom.xml index 57bbcc93..963d74b4 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1.2 pom + 2.18.1-S2 pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.3.2 + core-2.18.1-S2 diff --git a/validator/pom.xml b/validator/pom.xml index 40ecbe39..8d3062b3 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1.2 + 2.18.1-S2 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.1-SNAPSHOT + 2.18.1-S2 UTF-8 false From b3ee54effa88671b414f5872810b18dce16eac40 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 1 Aug 2025 17:55:22 +0200 Subject: [PATCH 20/40] [maven-release-plugin] prepare for next development iteration --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index dd380d7a..22f41162 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-S2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.1-S2 + 2.18.1-SNAPSHOT UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.1-S2 + 2.18.1-SNAPSHOT diff --git a/library/pom.xml b/library/pom.xml index fa3530f0..ab2d01f8 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.1-S2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject library - 2.18.1-S2 + 2.18.1-SNAPSHOT jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.18.1-S2 + core-2.3.2 diff --git a/pom.xml b/pom.xml index 963d74b4..4997578b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1-S2 pom + 2.18.1-SNAPSHOT pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.18.1-S2 + core-2.3.2 diff --git a/validator/pom.xml b/validator/pom.xml index 8d3062b3..f27218b7 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-S2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.1-S2 + 2.18.1-SNAPSHOT UTF-8 false From 74a939d1f15f161110fa3a071cafa191141aec1b Mon Sep 17 00:00:00 2001 From: jstaerk Date: Mon, 4 Aug 2025 10:18:03 +0200 Subject: [PATCH 21/40] closes #908 --- .../ZUGFeRD/ZUGFeRDInvoiceImporter.java | 16 ++++++++++++++++ .../mustangproject/validator/PDFValidator.java | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java index be49d7ec..41f7b823 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java @@ -71,6 +71,7 @@ public class ZUGFeRDInvoiceImporter { protected CalculatedInvoice importedInvoice = null; protected boolean recalcPrice = false; protected boolean ignoreCalculationErrors = false; + protected boolean containsAXMLFileAttachment = false; public ZUGFeRDInvoiceImporter() { //constructor for extending classes @@ -197,16 +198,31 @@ public class ZUGFeRDInvoiceImporter { ignoreCalculationErrors = true; } + + /*** + * if the file attachment is not in the list of allowed file names we can't import the XML, + * but the validator needs to know if maybe some other .xml-File is embedded because it would + * raise an additional notice that the filename is probably wrong + * + * @return + */ + public boolean hasXMLFileAttachment() { + return containsAXMLFileAttachment; + } /*** * sets th pdf attachments, and if a file is recognized (e.g. a factur-x.xml) triggers processing * @param names the Hashmap of String, PDComplexFileSpecification * @throws IOException */ private void extractFiles(Map names) throws IOException { + containsAXMLFileAttachment=false; for (final String alias : names.keySet()) { final PDComplexFileSpecification fileSpec = names.get(alias); final String filename = fileSpec.getFilename(); + if (filename.toUpperCase().endsWith(".XML")) { + containsAXMLFileAttachment=true; + } /** * filenames for invoice data (ZUGFeRD v1 and v2, Factur-X) */ diff --git a/validator/src/main/java/org/mustangproject/validator/PDFValidator.java b/validator/src/main/java/org/mustangproject/validator/PDFValidator.java index 0e35b714..b250fd9b 100644 --- a/validator/src/main/java/org/mustangproject/validator/PDFValidator.java +++ b/validator/src/main/java/org/mustangproject/validator/PDFValidator.java @@ -226,6 +226,13 @@ public class PDFValidator extends Validator { } if (!documentFilenameValid) { + if (zi.hasXMLFileAttachment()) { + context.addResultItem(new ValidationResultItem( + ESeverity.notice, + "Potentially incorrectly named XML file attachments detected" + ).setSection(17).setPart(EPart.pdf)); + } + context.addResultItem(new ValidationResultItem( ESeverity.error, "XMP Metadata: DocumentFileName contains invalid value" From 7b092191ef9fba2a43761676d1d68ad3e8c27153 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:02:19 +0200 Subject: [PATCH 22/40] [maven-release-plugin] rollback the release of core-2.18.1-S2 --- Mustang-CLI/pom.xml | 2 +- library/pom.xml | 2 +- pom.xml | 2 +- validator/pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index 22f41162..dba7846f 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.1.2 4.0.0 org.mustangproject diff --git a/library/pom.xml b/library/pom.xml index ab2d01f8..0d7dcd44 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -9,7 +9,7 @@ 4.0.0 org.mustangproject library - 2.18.1-SNAPSHOT + 2.18.1.2 jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT diff --git a/pom.xml b/pom.xml index 4997578b..57bbcc93 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1-SNAPSHOT pom + 2.18.1.2 pom Mustang diff --git a/validator/pom.xml b/validator/pom.xml index f27218b7..40ecbe39 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.1.2 4.0.0 org.mustangproject From 7f8676e88c4c6e56d1da7fcaa8476886bb0174d0 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:06:43 +0200 Subject: [PATCH 23/40] trying to stage release --- History.md | 5 +++-- Mustang-CLI/pom.xml | 4 ++-- doc/development_documentation.md | 1 + library/pom.xml | 4 ++-- pom.xml | 2 +- validator/pom.xml | 4 ++-- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/History.md b/History.md index 85ad4e39..917248dc 100644 --- a/History.md +++ b/History.md @@ -3,8 +3,9 @@ - #893 Tradeparty globalID is not read from JSON - #902 Tests to use definted TZ (UTC) - #905 Parse product level charges/discounts in UBL -- 869 -- 861 +- #869 Import Account Holder returns SellerTradeParty.name instead of AccountHolder +- #861 Multiple problems with Product.CountryOfOrigin +- #908 Validation: Make clear when embedded file name is wrong 2.18.0 ======= diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index dba7846f..2119f299 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1.2 + 2.18.0.2-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT UTF-8 11 diff --git a/doc/development_documentation.md b/doc/development_documentation.md index e940ebda..b73b437f 100644 --- a/doc/development_documentation.md +++ b/doc/development_documentation.md @@ -198,6 +198,7 @@ maybe not yet even existing new release version: ``` cd validator/target +mvn install:install-file -Dfile="validator-2.17.0-SNAPSHOT-shaded.jar" -Dclassifier=shaded -DgroupId="org.mustangproject" -DartifactId=validator -Dversion="2.17.0" -Dpackaging=jar -DgeneratePom=true ``` In gradle you can use something like ``` diff --git a/library/pom.xml b/library/pom.xml index 0d7dcd44..6062873a 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT 4.0.0 org.mustangproject library - 2.18.1.2 + 2.18.0.2-SNAPSHOT jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT diff --git a/pom.xml b/pom.xml index 57bbcc93..db867689 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1.2 pom + 2.18.0.2-SNAPSHOT pom Mustang diff --git a/validator/pom.xml b/validator/pom.xml index 40ecbe39..9ee626e1 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1.2 + 2.18.0.2-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT UTF-8 false From 34fb7a5221bb21501c52eb86b32658a4c20abaff Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:11:01 +0200 Subject: [PATCH 24/40] still trying to stage --- validator/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validator/pom.xml b/validator/pom.xml index 9ee626e1..7c1d76a4 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -25,7 +25,7 @@ ${project.groupId} library - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT org.dom4j From e63f82b1bd44af4a6737068d3c18ea5d2b29fd9b Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:18:15 +0200 Subject: [PATCH 25/40] staaaaging... --- Mustang-CLI/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index 2119f299..cd50121d 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT From b93382aef718ebe8ded99e1a1b12ed19376db084 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:23:12 +0200 Subject: [PATCH 26/40] [maven-release-plugin] prepare release core-2.18.0.2 --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index cd50121d..df6359ee 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2-SNAPSHOT + 2.18.0.2 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.0.2-SNAPSHOT + 2.18.0.2 UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.0.2-SNAPSHOT + 2.18.0.2 diff --git a/library/pom.xml b/library/pom.xml index 6062873a..fc702254 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.0.2-SNAPSHOT + 2.18.0.2 4.0.0 org.mustangproject library - 2.18.0.2-SNAPSHOT + 2.18.0.2 jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.3.2 + core-2.18.0.2 diff --git a/pom.xml b/pom.xml index db867689..746f42c4 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.0.2-SNAPSHOT pom + 2.18.0.2 pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.3.2 + core-2.18.0.2 diff --git a/validator/pom.xml b/validator/pom.xml index 7c1d76a4..a26d2c8f 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2-SNAPSHOT + 2.18.0.2 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.0.2-SNAPSHOT + 2.18.0.2 UTF-8 false @@ -25,7 +25,7 @@ ${project.groupId} library - 2.18.0.2-SNAPSHOT + 2.18.0.2 org.dom4j From 1ae4bcc9f6f9b4a6237613fa67c194f137805cf5 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:24:23 +0200 Subject: [PATCH 27/40] [maven-release-plugin] prepare for next development iteration --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index df6359ee..22f41162 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.0.2 + 2.18.1-SNAPSHOT UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.0.2 + 2.18.1-SNAPSHOT diff --git a/library/pom.xml b/library/pom.xml index fc702254..ab2d01f8 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject library - 2.18.0.2 + 2.18.1-SNAPSHOT jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.18.0.2 + core-2.3.2 diff --git a/pom.xml b/pom.xml index 746f42c4..4997578b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.0.2 pom + 2.18.1-SNAPSHOT pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.18.0.2 + core-2.3.2 diff --git a/validator/pom.xml b/validator/pom.xml index a26d2c8f..f27218b7 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.0.2 + 2.18.1-SNAPSHOT UTF-8 false @@ -25,7 +25,7 @@ ${project.groupId} library - 2.18.0.2 + 2.18.1-SNAPSHOT org.dom4j From 1fca1e1e3acd8cc0816242cb72f4c784c96cbdbe Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:36:32 +0200 Subject: [PATCH 28/40] [maven-release-plugin] rollback the release of core-2.18.0.2 --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 4 ++-- pom.xml | 2 +- validator/pom.xml | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index 22f41162..cd50121d 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT diff --git a/library/pom.xml b/library/pom.xml index ab2d01f8..6062873a 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT 4.0.0 org.mustangproject library - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT diff --git a/pom.xml b/pom.xml index 4997578b..db867689 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1-SNAPSHOT pom + 2.18.0.2-SNAPSHOT pom Mustang diff --git a/validator/pom.xml b/validator/pom.xml index f27218b7..7c1d76a4 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT UTF-8 false @@ -25,7 +25,7 @@ ${project.groupId} library - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT org.dom4j From 0352c3905c5f1aaa43bf4501e9aec181ecf3bbd3 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:37:14 +0200 Subject: [PATCH 29/40] trying to update mvn release plugin --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index db867689..2637de48 100644 --- a/pom.xml +++ b/pom.xml @@ -29,7 +29,7 @@ error message :-( --> org.apache.maven.plugins maven-release-plugin - 2.5.3 + 3.1.1 true false From 14d079049c826f2515d4ca308491a9ba9f705d23 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:38:53 +0200 Subject: [PATCH 30/40] still trying to update release plugin --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2637de48..a433574a 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ org.apache.maven.scm maven-scm-provider-gitexe - 1.9.5 + 2.1.0 From f11da13f2c6ce19dc9a517def2d5c5b61cdf68f7 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:44:29 +0200 Subject: [PATCH 31/40] [maven-release-plugin] prepare release core-2.18.0.2 --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index cd50121d..df6359ee 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2-SNAPSHOT + 2.18.0.2 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.0.2-SNAPSHOT + 2.18.0.2 UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.0.2-SNAPSHOT + 2.18.0.2 diff --git a/library/pom.xml b/library/pom.xml index 6062873a..fc702254 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.0.2-SNAPSHOT + 2.18.0.2 4.0.0 org.mustangproject library - 2.18.0.2-SNAPSHOT + 2.18.0.2 jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.3.2 + core-2.18.0.2 diff --git a/pom.xml b/pom.xml index a433574a..d186db05 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.0.2-SNAPSHOT pom + 2.18.0.2 pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.3.2 + core-2.18.0.2 diff --git a/validator/pom.xml b/validator/pom.xml index 7c1d76a4..a26d2c8f 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2-SNAPSHOT + 2.18.0.2 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.0.2-SNAPSHOT + 2.18.0.2 UTF-8 false @@ -25,7 +25,7 @@ ${project.groupId} library - 2.18.0.2-SNAPSHOT + 2.18.0.2 org.dom4j From 6b47ae85eb229aed6c6ea8d4e9496542912c0401 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:44:31 +0200 Subject: [PATCH 32/40] [maven-release-plugin] prepare for next development iteration --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 6 +++--- pom.xml | 4 ++-- validator/pom.xml | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index df6359ee..22f41162 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.0.2 + 2.18.1-SNAPSHOT UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.0.2 + 2.18.1-SNAPSHOT diff --git a/library/pom.xml b/library/pom.xml index fc702254..ab2d01f8 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject library - 2.18.0.2 + 2.18.1-SNAPSHOT jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -20,7 +20,7 @@ scm:git:https://github.com/ZUGFeRD/mustangproject.git scm:git:https://github.com/ZUGFeRD/mustangproject.git https://github.com/ZUGFeRD/mustangproject - core-2.18.0.2 + core-2.3.2 diff --git a/pom.xml b/pom.xml index d186db05..f4d35713 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.0.2 pom + 2.18.1-SNAPSHOT pom Mustang @@ -19,7 +19,7 @@ scm:git:git://github.com/dexecutor/dependent-tasks-executor.git scm:git:git@github.com:dexecutor/dexecutor.git https://github.com/dexecutor/dependent-tasks-executor - core-2.18.0.2 + core-2.3.2 diff --git a/validator/pom.xml b/validator/pom.xml index a26d2c8f..f27218b7 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2 + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.0.2 + 2.18.1-SNAPSHOT UTF-8 false @@ -25,7 +25,7 @@ ${project.groupId} library - 2.18.0.2 + 2.18.1-SNAPSHOT org.dom4j From c40e07dee91909ada6e3705a414115128e2394c8 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 09:57:32 +0200 Subject: [PATCH 33/40] [maven-release-plugin] rollback the release of core-2.18.0.2 --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 4 ++-- pom.xml | 2 +- validator/pom.xml | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index 22f41162..cd50121d 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT diff --git a/library/pom.xml b/library/pom.xml index ab2d01f8..6062873a 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT 4.0.0 org.mustangproject library - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT diff --git a/pom.xml b/pom.xml index f4d35713..a433574a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.1-SNAPSHOT pom + 2.18.0.2-SNAPSHOT pom Mustang diff --git a/validator/pom.xml b/validator/pom.xml index f27218b7..7c1d76a4 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT UTF-8 false @@ -25,7 +25,7 @@ ${project.groupId} library - 2.18.1-SNAPSHOT + 2.18.0.2-SNAPSHOT org.dom4j From 7a17055f8c76952112899a33be70b8c7538b2959 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 5 Aug 2025 10:35:07 +0200 Subject: [PATCH 34/40] revert to old POMS (with surefire UTC) --- Mustang-CLI/pom.xml | 6 +++--- library/pom.xml | 16 ++++++++++++++-- pom.xml | 36 ++++++++++++++++++++++++------------ validator/pom.xml | 19 ++++++++++++++++--- 4 files changed, 57 insertions(+), 20 deletions(-) diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml index cd50121d..22f41162 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2-SNAPSHOT + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.18.0.2-SNAPSHOT + 2.18.1-SNAPSHOT UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.18.0.2-SNAPSHOT + 2.18.1-SNAPSHOT diff --git a/library/pom.xml b/library/pom.xml index 6062873a..10442661 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.18.0.2-SNAPSHOT + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject library - 2.18.0.2-SNAPSHOT + 2.18.1-SNAPSHOT jar Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII) FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT @@ -22,6 +22,18 @@ https://github.com/ZUGFeRD/mustangproject core-2.3.2 + + + sonatype-oss-public + https://oss.sonatype.org/content/groups/public/ + + true + + + true + + + internal.repo diff --git a/pom.xml b/pom.xml index a433574a..52b863b8 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.18.0.2-SNAPSHOT pom + 2.18.1-SNAPSHOT pom Mustang @@ -29,7 +29,7 @@ error message :-( --> org.apache.maven.plugins maven-release-plugin - 3.1.1 + 2.5.3 true false @@ -40,7 +40,7 @@ org.apache.maven.scm maven-scm-provider-gitexe - 2.1.0 + 1.9.5 @@ -67,19 +67,31 @@ + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.7.0 + true + + ossrh + https://ossrh-staging-api.central.sonatype.com/ + true + + org.apache.maven.plugins maven-surefire-plugin - 3.5.3 alphabetical - -Duser.timezone=UTC org.apache.maven.plugins maven-source-plugin - 3.3.1 + 3.2.1 + + UTF-8 + attach-javadoc @@ -91,14 +103,14 @@ - - gitlab-maven - https://dev.usegroup.de/api/v4/projects/63/packages/maven - - gitlab-maven - https://dev.usegroup.de/api/v4/projects/63/packages/maven + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + UTF-8 diff --git a/validator/pom.xml b/validator/pom.xml index 7c1d76a4..57866cba 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.18.0.2-SNAPSHOT + 2.18.1-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,20 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.18.0.2-SNAPSHOT + 2.18.1-SNAPSHOT + + + + sonatype-oss-public + https://oss.sonatype.org/content/groups/public/ + + true + + + true + + + UTF-8 false @@ -25,7 +38,7 @@ ${project.groupId} library - 2.18.0.2-SNAPSHOT + 2.18.1-SNAPSHOT org.dom4j From d1522479bb83e4ad918468fc2d81a6897cf3e8b6 Mon Sep 17 00:00:00 2001 From: langfr Date: Wed, 6 Aug 2025 19:59:19 +0100 Subject: [PATCH 35/40] ShipToTradeParty should not contain URIUniversalCommunication --- .../org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java | 8 +++----- .../src/test/java/org/mustangproject/ZUGFeRD/XRTest.java | 1 + .../java/org/mustangproject/validator/LibraryTest.java | 3 +++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java index 6efb4b23..106a8e54 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java @@ -219,7 +219,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider { xml += "" + XMLTools.encodeXML(party.getCountry()) + "" + ""; - if (party.getUriUniversalCommunicationID() != null && party.getUriUniversalCommunicationIDScheme() != null) { + if (party.getUriUniversalCommunicationID() != null && party.getUriUniversalCommunicationIDScheme() != null && (!isShipToTradeParty)) { xml += "" + "" + XMLTools.encodeXML(party.getUriUniversalCommunicationID()) @@ -462,10 +462,8 @@ public class ZUGFeRD2PullProvider implements IXMLProvider { } xml += "" + XMLTools.encodeXML(currentItem.getProduct().getName()) + ""; - if (currentItem.getProduct().getDescription() != null) { - xml += "" + - XMLTools.encodeXML(currentItem.getProduct().getDescription()) + - ""; + if (currentItem.getProduct().getDescription() != null && !currentItem.getProduct().getDescription().isEmpty()) { + xml += "" + XMLTools.encodeXML(currentItem.getProduct().getDescription()) + ""; } if (currentItem.getProduct().getClassifications() != null) { for (IDesignatedProductClassification classification : currentItem.getProduct().getClassifications()) { diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java index 3a211610..42fd653c 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/XRTest.java @@ -106,6 +106,7 @@ public class XRTest extends TestCase { Invoice i = new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()) .setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").setEmail("sender@example.com").addTaxID("DE4711").addVATID("DE0815").setContact(new Contact("Hans Test", "+49123456789", "test@example.org")).addBankDetails(new BankDetails("DE12500105170648489890", "COBADEFXXX").setAccountName("kontoInhaber"))) .setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").setEmail("recipient@sample.org")) + .setDeliveryAddress(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").setEmail("recipient@sample.org")) .addCashDiscount(new CashDiscount(new BigDecimal(2), 7)) .addCashDiscount(new CashDiscount(new BigDecimal(3), 14)) .setReferenceNumber("991-01484-64")//leitweg-id diff --git a/validator/src/test/java/org/mustangproject/validator/LibraryTest.java b/validator/src/test/java/org/mustangproject/validator/LibraryTest.java index 1cf5fd12..62850db3 100644 --- a/validator/src/test/java/org/mustangproject/validator/LibraryTest.java +++ b/validator/src/test/java/org/mustangproject/validator/LibraryTest.java @@ -177,6 +177,9 @@ public class LibraryTest extends ResourceCase { assertThat(res).valueByXPath("count(//error)") .asInt() .isEqualTo(0); + assertThat(res).valueByXPath("count(//warning)") + .asInt() + .isEqualTo(0); assertThat(res).valueByXPath("/validation/summary/@status") .asString() .isEqualTo("valid");// expect to be valid because XR notices are, well, only notices From 10c22314e43c032a6902619a0e2ff6b68ad29117 Mon Sep 17 00:00:00 2001 From: langfr Date: Thu, 7 Aug 2025 19:53:57 +0100 Subject: [PATCH 36/40] Update validation to XRechnung 3.0.2. --- .../ZUGFeRD/ZUGFeRD2PullProvider.java | 6 +- .../xslt/XR_30/XRechnung-CII-validation.xslt | 670 ++++++++++++++---- .../xslt/XR_30/XRechnung-UBL-validation.xslt | 520 +++++++++++--- .../validator/ZUGFeRDValidatorTest.java | 6 +- .../CII_XRechnung_with_Peppol_violation.xml | 3 + validator/src/test/resources/validXRV30.xml | 8 + 6 files changed, 933 insertions(+), 280 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java index 6efb4b23..1585f010 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java @@ -462,10 +462,8 @@ public class ZUGFeRD2PullProvider implements IXMLProvider { } xml += "" + XMLTools.encodeXML(currentItem.getProduct().getName()) + ""; - if (currentItem.getProduct().getDescription() != null) { - xml += "" + - XMLTools.encodeXML(currentItem.getProduct().getDescription()) + - ""; + if (currentItem.getProduct().getDescription() != null && !currentItem.getProduct().getDescription().isEmpty()) { + xml += "" + XMLTools.encodeXML(currentItem.getProduct().getDescription()) + ""; } if (currentItem.getProduct().getClassifications() != null) { for (IDesignatedProductClassification classification : currentItem.getProduct().getClassifications()) { diff --git a/validator/src/main/resources/xslt/XR_30/XRechnung-CII-validation.xslt b/validator/src/main/resources/xslt/XR_30/XRechnung-CII-validation.xslt index 14b1a296..84b8788d 100644 --- a/validator/src/main/resources/xslt/XR_30/XRechnung-CII-validation.xslt +++ b/validator/src/main/resources/xslt/XR_30/XRechnung-CII-validation.xslt @@ -30,6 +30,12 @@ indent="yes"/> + + + + @@ -120,6 +126,25 @@ + + + + + + + + + + + + + + + + + @@ -245,7 +270,7 @@   @@ -272,7 +297,7 @@ variable-pattern - + @@ -281,7 +306,7 @@ peppol-cii-pattern-1 - + @@ -290,7 +315,7 @@ peppol-cii-pattern-0-a - + @@ -299,7 +324,7 @@ peppol-cii-pattern-0-b - + @@ -308,7 +333,7 @@ cii-pattern - + @@ -317,45 +342,67 @@ cii-extension-pattern - + + + + + + cii-cvd-pattern + cii-cvd-pattern + + + - Schematron Version @xr-schematron.version.full@ - XRechnung @xrechnung.version@ compatible - CII + Schematron Version 2.4.0 - XRechnung 3.0.2 compatible - CII + + + - + select="'(^|\r?\n)#(SKONTO)#TAGE=([0-9]+#PROZENT=[0-9]+\.[0-9]{2})(#BASISBETRAG=-?[0-9]+\.[0-9]{2})?#$'"/> + + + select="' 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240'"/> + select="' 0002 0007 0009 0037 0060 0088 0096 0097 0106 0130 0135 0142 0147 0151 0154 0158 0170 0177 0183 0184 0188 0190 0191 0192 0193 0194 0195 0196 0198 0199 0200 0201 0202 0203 0204 0205 0208 0209 0210 0211 0212 0213 0215 0216 0217 0218 0219 0220 0221 0225 0230 0240 0235 9910 9913 9914 9915 9918 9919 9920 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9957 9959 AN AQ AS AU EM '"/> - - - + + + + + + + + - + @@ -365,7 +412,7 @@ PEPPOL-EN16931-R001 - warning + fatal @@ -373,12 +420,12 @@ - + + mode="M27"> @@ -388,7 +435,7 @@ PEPPOL-EN16931-R005 - warning + fatal @@ -403,7 +450,7 @@ PEPPOL-EN16931-R053 - warning + fatal @@ -418,7 +465,7 @@ PEPPOL-EN16931-R054 - warning + fatal @@ -433,18 +480,18 @@ PEPPOL-EN16931-R055 - warning + fatal - + Invoice total VAT amount and Invoice total VAT amount in accounting currency MUST have the same operational sign - + - + @@ -453,7 +500,7 @@ PEPPOL-EN16931-R010 - warning + fatal @@ -461,10 +508,10 @@ - + - + @@ -473,7 +520,7 @@ PEPPOL-EN16931-R020 - warning + fatal @@ -481,12 +528,12 @@ - + + mode="M27"> @@ -495,7 +542,7 @@ PEPPOL-EN16931-R041 - warning + fatal @@ -504,12 +551,12 @@ - + + mode="M27"> @@ -518,7 +565,7 @@ PEPPOL-EN16931-R042 - warning + fatal @@ -527,22 +574,22 @@ - + + mode="M27"> - + + test="not(ram:CalculationPercent and ram:BasisAmount) or u:slack(if (ram:ActualAmount) then ram:ActualAmount else 0, (xs:decimal(ram:BasisAmount) * xs:decimal(ram:CalculationPercent)) div 100, $slackValue)"> PEPPOL-EN16931-R040 - warning + fatal @@ -557,7 +604,7 @@ PEPPOL-EN16931-R043-1 - warning + fatal @@ -565,10 +612,10 @@ - + - + @@ -578,7 +625,7 @@ PEPPOL-EN16931-R043-2 - warning + fatal @@ -586,12 +633,12 @@ - + + mode="M27"> @@ -601,7 +648,7 @@ PEPPOL-EN16931-R061 - warning + fatal @@ -609,12 +656,12 @@ - + + mode="M27"> @@ -624,7 +671,7 @@ PEPPOL-EN16931-R110 - warning + fatal @@ -632,12 +679,12 @@ - + + mode="M27"> @@ -647,7 +694,7 @@ PEPPOL-EN16931-R111 - warning + fatal @@ -655,12 +702,12 @@ - + + mode="M27"> PEPPOL-EN16931-R101 - warning + fatal @@ -690,12 +737,12 @@ - + + mode="M27"> @@ -705,7 +752,7 @@ PEPPOL-EN16931-R121 - warning + fatal @@ -713,12 +760,12 @@ - + + mode="M27"> @@ -728,7 +775,7 @@ PEPPOL-EN16931-R130 - warning + fatal @@ -736,17 +783,17 @@ - + - - - + + + + mode="M28"> @@ -755,7 +802,7 @@ PEPPOL-EN16931-R008 - warning + fatal @@ -763,17 +810,17 @@ - + - - - + + + + mode="M29"> @@ -783,7 +830,7 @@ PEPPOL-EN16931-R044 - warning + fatal @@ -793,12 +840,12 @@ - + + test="not(ram:ChargeAmount) or xs:decimal(../ram:NetPriceProductTradePrice/ram:ChargeAmount) = xs:decimal(ram:ChargeAmount) - u:decimalOrZero(ram:AppliedTradeAllowanceCharge/ram:ActualAmount[1])"> PEPPOL-EN16931-R046 - warning + fatal @@ -806,15 +853,15 @@ - + - - - + + + - + - + + test="not((rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:TypeCode = 'VAT' and rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:CategoryTradeTax = 'VAT' and rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeAllowanceCharge/ram:CategoryTradeTax/ram:CategoryCode = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M')) or (rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:TypeCode = 'VAT' and rsm:SupplyChainTradeTransaction/ram:IncludedSupplyChainTradeLineItem/ram:SpecifiedLineTradeSettlement/ram:ApplicableTradeTax/ram:CategoryCode = ('S', 'Z', 'E', 'AE', 'K', 'G', 'L', 'M'))) or ((rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTradeParty/ram:SpecifiedTaxRegistration/ram:ID[normalize-space(@schemeID)='VA' or normalize-space(@schemeID)='FC'][boolean(normalize-space(.))], rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeAgreement/ram:SellerTaxRepresentativeTradeParty))"> BR-DE-16 fatal @@ -904,10 +951,10 @@ - + + test="normalize-space(rsm:ExchangedDocument/ram:TypeCode) = ('326', '380', '384', '389', '381', '875', '876', '877')"> BR-DE-17 warning @@ -953,10 +1000,10 @@ - + + test="not(normalize-space(rsm:ExchangedDocument/ram:TypeCode) = '384') or (rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:InvoiceReferencedDocument)"> BR-DE-26 warning @@ -966,20 +1013,20 @@ - + + priority="1012" + mode="M30"> - + + test="ram:GuidelineSpecifiedDocumentContextParameter/ram:ID = $XR-CIUS-ID or ram:GuidelineSpecifiedDocumentContextParameter/ram:ID = $XR-EXTENSION-ID or ram:GuidelineSpecifiedDocumentContextParameter/ram:ID = $XR-CVD-ID"> BR-DE-21 warning @@ -989,12 +1036,12 @@ - + + priority="1011" + mode="M30"> @@ -1011,12 +1058,12 @@ - + + priority="1010" + mode="M30"> @@ -1049,12 +1096,12 @@ - + + priority="1009" + mode="M30"> @@ -1132,12 +1179,12 @@ - + + priority="1008" + mode="M30"> @@ -1170,12 +1217,35 @@ - + + + + + + + + + + + BR-TMP-2 + warning + + + + [BR-TMP-2] BT-124 "External document location" muss eine absolute URL mit gültigem Schema enthalten. + + + + + priority="1006" + mode="M30"> @@ -1208,20 +1278,20 @@ - + - + + context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[normalize-space(ram:TypeCode) = ('30','58')]"/> - + + test="not(normalize-space(ram:TypeCode) = '58') or matches(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(ram:PayeePartyCreditorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then string($cp - 55) else string($cp - 48)),'')) mod 97 = 1"> BR-DE-19 warning @@ -1261,14 +1331,14 @@ - + - + + context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[normalize-space(ram:TypeCode) = ('48','54','55')]"/> @@ -1299,20 +1369,20 @@ - + - + + context="/rsm:CrossIndustryInvoice/rsm:SupplyChainTradeTransaction/ram:ApplicableHeaderTradeSettlement/ram:SpecifiedTradeSettlementPaymentMeans[normalize-space(ram:TypeCode) = '59']"/> - + + test="not(normalize-space(ram:TypeCode) = '59') or matches(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:decimal(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(ram:PayerPartyDebtorFinancialAccount/ram:IBANID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then string($cp - 55) else string($cp - 48)),'')) mod 97 = 1"> BR-DE-20 warning @@ -1352,12 +1422,12 @@ - + + priority="1002" + mode="M30"> @@ -1375,19 +1445,67 @@ - + - - - + + + + + + + + + BR-DE-TMP-32 + information + + + + + [BR-DE-TMP-32] Eine Rechnung sollte zur Angabe des Liefer-/Leistungsdatums entweder BT-72 "Actual delivery date", BG-14 "Invoicing period" oder in jeder Rechnungsposition BG-26 "Invoice line period" enthalten. + + + + + + + + + + + + + + + BR-TMP-3 + fatal + + + + [BR-TMP-3] If both elements to which BT-149 and BT-150 can be mapped are present, both must be equal. + + + + + + + + + priority="1006" + mode="M31"> @@ -1407,12 +1525,12 @@ - + + priority="1005" + mode="M31"> @@ -1432,12 +1550,12 @@ - + + priority="1004" + mode="M31"> @@ -1457,12 +1575,12 @@ - + + priority="1003" + mode="M31"> @@ -1482,12 +1600,12 @@ - + + priority="1002" + mode="M31"> @@ -1507,12 +1625,12 @@ - + + priority="1001" + mode="M31"> @@ -1532,10 +1650,248 @@ - + - - - + + + + + + + + + BR-DEX-01 + fatal + + + + [BR-DEX-01] Das Element + + "Attached Document" (BT-125) benutzt einen nicht zulässigen MIME-Code: + + . Im Falle einer Extension darf zusätzlich zu der Liste der mime codes (definiert in Abschnitt 8.2, "Binary Object") der MIME-Code application/xml genutzt werden. + + + + + + + + + + + + + + + + + + + + BR-DE-CVD-03 + fatal + + + + + [BR-DE-CVD-03] In einer Rechnung muss mindestens eine + + INVOICE LINE (BG-25) enthalten sein, in der der Scheme identifier von + + "Item classification identifier" (BT-158) den Wert 'CVD' und der + + "Item attribute name" (BT-160) den Wert 'cva' enthält. + + + + + + + + + + + + + + + BR-DE-CVD-06-b + fatal + + + + + [BR-DE-CVD-06-b] Wenn + + "Item attribute name" (BT-160) mit dem Wert 'cva' angegeben ist, muss in derselben Rechnungszeile genau ein + + "Item classification identifier" (BT-158) mit dem Scheme identifier 'CVD' vorhanden sein. + + + + + + + + + + BR-DE-CVD-06-a + fatal + + + + + [BR-DE-CVD-06-a] Wenn der Scheme identifier von + + "Item classification identifier" (BT-158) mit dem Wert 'CVD' angegeben ist, muss in derselben Rechnungszeile genau ein + + "Item attribute name" (BT-160) mit dem Wert 'cva' vorhanden sein. + + + + + + + + + + + + + + + BR-TMP-CVD-01 + fatal + + + + + [BR-TMP-CVD-01] Das Bildungsschema für + + "Item classification identifier" (BT-158) ist aus der Codeliste UNTDID 7143 zu wählen. + + + + + + + + + + BR-DE-CVD-04 + fatal + + + + + [BR-DE-CVD-04] Ein + + "Item classification identifier" (BT-158) mit dem Scheme identifier 'CVD' muss einen Wert aus der Liste der zulässigen Fahrzeugkategorien enthalten. + + + + + + + + + + + + + + + BR-DE-CVD-05 + fatal + + + + + [BR-DE-CVD-05] Wenn innerhalb von + + ITEM ATTRIBUTES (BG-32) der + + "Item attribute name" (BT-160) den Wert 'cva' hat, muss der + + "Item attribute value" (BT-161) einen der zulässigen Werte enthalten. + + + + + + + + + + + + + + + BR-DE-CVD-01 + fatal + + + + + [BR-DE-CVD-01] Das Element + + "Contract reference" (BT-12) muss übermittelt werden. + + + + + + + + + + BR-DE-CVD-02 + fatal + + + + + [BR-DE-CVD-02] Das Element + + "Tender or lot reference" (BT-17) muss übermittelt werden. + + + + + + + + + diff --git a/validator/src/main/resources/xslt/XR_30/XRechnung-UBL-validation.xslt b/validator/src/main/resources/xslt/XR_30/XRechnung-UBL-validation.xslt index f77bc205..76e093d0 100644 --- a/validator/src/main/resources/xslt/XR_30/XRechnung-UBL-validation.xslt +++ b/validator/src/main/resources/xslt/XR_30/XRechnung-UBL-validation.xslt @@ -132,6 +132,25 @@ select=" (number($digits[8])*2) + (number($digits[7])*4) + (number($digits[6])*8) + (number($digits[5])*16) + (number($digits[4])*32) + (number($digits[3])*64) + (number($digits[2])*128) + (number($digits[1])*256) "/> + + + + + + + + + + + + + + + + + @@ -257,7 +276,7 @@   @@ -289,7 +308,7 @@ variable-pattern - + @@ -298,7 +317,7 @@ peppol-ubl-pattern-1 - + @@ -307,7 +326,7 @@ peppol-ubl-pattern-2 - + @@ -316,7 +335,7 @@ ubl-pattern - + @@ -325,18 +344,33 @@ ubl-extension-pattern - + + + + + + ubl-cvd-pattern + ubl-cvd-pattern + + + - Schematron Version @xr-schematron.version.full@ - XRechnung @xrechnung.version@ compatible - UBL - Invoice / Creditnote + Schematron Version 2.4.0 - XRechnung 3.0.2 compatible - UBL - Invoice / Creditnote + + + + + - + select="'(^|\r?\n)#(SKONTO)#TAGE=([0-9]+#PROZENT=[0-9]+\.[0-9]{2})(#BASISBETRAG=-?[0-9]+\.[0-9]{2})?#$'"/> + + + select="' 0002 0003 0004 0005 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 0017 0018 0019 0020 0021 0022 0023 0024 0025 0026 0027 0028 0029 0030 0031 0032 0033 0034 0035 0036 0037 0038 0039 0040 0041 0042 0043 0044 0045 0046 0047 0048 0049 0050 0051 0052 0053 0054 0055 0056 0057 0058 0059 0060 0061 0062 0063 0064 0065 0066 0067 0068 0069 0070 0071 0072 0073 0074 0075 0076 0077 0078 0079 0080 0081 0082 0083 0084 0085 0086 0087 0088 0089 0090 0091 0093 0094 0095 0096 0097 0098 0099 0100 0101 0102 0104 0105 0106 0107 0108 0109 0110 0111 0112 0113 0114 0115 0116 0117 0118 0119 0120 0121 0122 0123 0124 0125 0126 0127 0128 0129 0130 0131 0132 0133 0134 0135 0136 0137 0138 0139 0140 0141 0142 0143 0144 0145 0146 0147 0148 0149 0150 0151 0152 0153 0154 0155 0156 0157 0158 0159 0160 0161 0162 0163 0164 0165 0166 0167 0168 0169 0170 0171 0172 0173 0174 0175 0176 0177 0178 0179 0180 0183 0184 0185 0186 0187 0188 0189 0190 0191 0192 0193 0194 0195 0196 0197 0198 0199 0200 0201 0202 0203 0204 0205 0206 0207 0208 0209 0210 0211 0212 0213 0214 0215 0216 0217 0218 0219 0220 0221 0222 0223 0224 0225 0226 0227 0228 0229 0230 0231 0232 0233 0234 0235 0236 0237 0238 0239 0240'"/> + select="' 0002 0007 0009 0037 0060 0088 0096 0097 0106 0130 0135 0142 0147 0151 0154 0158 0170 0177 0183 0184 0188 0190 0191 0192 0193 0194 0195 0196 0198 0199 0200 0201 0202 0203 0204 0205 0208 0209 0210 0211 0212 0213 0215 0216 0217 0218 0219 0220 0221 0225 0230 0240 0235 9910 9913 9914 9915 9918 9919 9920 9922 9923 9924 9925 9926 9927 9928 9929 9930 9931 9932 9933 9934 9935 9936 9937 9938 9939 9940 9941 9942 9943 9944 9945 9946 9947 9948 9949 9950 9951 9952 9953 9957 9959 AN AQ AS AU EM '"/> - - - + + + + + + + + + mode="M36"> @@ -389,17 +434,17 @@ - + - - - + + + + mode="M37"> @@ -461,10 +506,10 @@ - + - + @@ -481,12 +526,12 @@ - + + mode="M37"> @@ -503,12 +548,12 @@ - + + mode="M37"> @@ -525,12 +570,12 @@ - + + mode="M37"> @@ -547,12 +592,12 @@ - + + mode="M37"> @@ -569,20 +614,20 @@ - + + mode="M37"> - + + test="not(cbc:MultiplierFactorNumeric and cbc:BaseAmount) or u:slack(if (cbc:Amount) then cbc:Amount else 0, (xs:decimal(cbc:BaseAmount) * xs:decimal(cbc:MultiplierFactorNumeric)) div 100, $slackValue)"> PEPPOL-EN16931-R040 fatal @@ -607,12 +652,12 @@ - + + mode="M37"> @@ -630,12 +675,12 @@ - + + mode="M37"> @@ -653,12 +698,12 @@ - + + mode="M37"> @@ -676,12 +721,12 @@ - + + mode="M37"> - + + test="u:slack($lineExtensionAmount, ($quantity * ($priceAmount div $baseQuantity)) + $chargesTotal - $allowancesTotal, $slackValue)"> PEPPOL-EN16931-R120 fatal @@ -741,10 +786,10 @@ - + - + @@ -777,12 +822,12 @@ - + + mode="M37"> - + - - - + + + - + @@ -876,10 +921,10 @@ select="('326', '380', '384', '389', '381', '875', '876', '877')"/> - + + test="normalize-space(cbc:InvoiceTypeCode) = $supportedInvAndCNTypeCodes or normalize-space(cbc:CreditNoteTypeCode) = $supportedInvAndCNTypeCodes"> BR-DE-17 warning @@ -910,10 +955,10 @@ - + + test="cbc:CustomizationID = $XR-CIUS-ID or cbc:CustomizationID = $XR-EXTENSION-ID or cbc:CustomizationID = $XR-CVD-ID"> BR-DE-21 warning @@ -940,10 +985,10 @@ - + + test="((not(normalize-space(cbc:InvoiceTypeCode) = '384' or normalize-space(cbc:CreditNoteTypeCode) = '384') or (cac:BillingReference/cac:InvoiceDocumentReference)))"> BR-DE-26 warning @@ -983,12 +1028,52 @@ - + + + + + + BR-DE-TMP-32 + information + + + + + [BR-DE-TMP-32] Eine Rechnung sollte zur Angabe des Liefer-/Leistungsdatums entweder BT-72 "Actual delivery date", BG-14 "Invoicing period" oder in jeder Rechnungsposition BG-26 "Invoice line period" enthalten. + + + + + + + + + + + + + + + BR-TMP-2 + warning + + + + [BR-TMP-2] BT-124 "External document location" muss eine absolute URL mit gültigem Schema enthalten. + + + + + mode="M38"> @@ -1005,12 +1090,12 @@ - + + mode="M38"> @@ -1043,12 +1128,12 @@ - + + mode="M38"> @@ -1126,12 +1211,12 @@ - + + mode="M38"> @@ -1164,12 +1249,12 @@ - + + mode="M38"> @@ -1202,20 +1287,20 @@ - + - + mode="M38"> + context="/ubl:Invoice/cac:PaymentMeans[normalize-space(cbc:PaymentMeansCode) = ('30','58')] | /cn:CreditNote/cac:PaymentMeans[normalize-space(cbc:PaymentMeansCode) = ('30','58')]"/> - + + test="not(normalize-space(cbc:PaymentMeansCode) = '58') or matches(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:integer(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PayeeFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then string($cp - 55) else string($cp - 48)),'')) mod 97 = 1"> BR-DE-19 warning @@ -1255,14 +1340,14 @@ - + - + mode="M38"> + context="/ubl:Invoice/cac:PaymentMeans[normalize-space(cbc:PaymentMeansCode) = ('48','54','55')] |/cn:CreditNote/cac:PaymentMeans[normalize-space(cbc:PaymentMeansCode) = ('48','54','55')]"/> @@ -1292,20 +1377,20 @@ - + - + mode="M38"> + context="/ubl:Invoice/cac:PaymentMeans[normalize-space(cbc:PaymentMeansCode) = '59'] | /cn:CreditNote/cac:PaymentMeans[normalize-space(cbc:PaymentMeansCode) = '59']"/> - + + test="not(normalize-space(cbc:PaymentMeansCode) = '59') or matches(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')), '^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{0,30}$') and xs:decimal(string-join(for $cp in string-to-codepoints(concat(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),5),upper-case(substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),1,2)),substring(normalize-space(replace(cac:PaymentMandate/cac:PayerFinancialAccount/cbc:ID, '([ \n\r\t\s])', '')),3,2))) return (if($cp > 64) then string($cp - 55) else string($cp - 48)),'')) mod 97 = 1"> BR-DE-20 warning @@ -1344,12 +1429,12 @@ - + + mode="M38"> @@ -1367,11 +1452,11 @@ - + - - - + + + + mode="M39"> @@ -1401,18 +1486,18 @@ - + - + - + + test="(every $invoiceline in /ubl:Invoice/cac:InvoiceLine[ exists (./cac:SubInvoiceLine) ] satisfies $invoiceline/xs:decimal(cbc:LineExtensionAmount) = sum($invoiceline/cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))) and (count( //cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0 and xs:decimal(cbc:LineExtensionAmount) = sum(cac:SubInvoiceLine/xs:decimal(cbc:LineExtensionAmount))]) = count(//cac:SubInvoiceLine [count(cac:SubInvoiceLine) > 0]))"> BR-DEX-02 warning @@ -1440,12 +1525,12 @@ - + + mode="M39"> - [BR-DEX-09] Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) - Paid amount (BT-113) + Rounding amount (BT-114) - Σ Third party payment amount (BT-DEX-002). + [BR-DEX-09] Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) - Paid amount (BT-113) + Rounding amount (BT-114) + Σ Third party payment amount (BT-DEX-002). - + + mode="M39"> @@ -1494,12 +1579,12 @@ - + + mode="M39"> @@ -1519,12 +1604,12 @@ - + + mode="M39"> @@ -1544,12 +1629,12 @@ - + + mode="M39"> @@ -1569,12 +1654,12 @@ - + + mode="M39"> @@ -1594,12 +1679,12 @@ - + + mode="M39"> @@ -1677,10 +1762,213 @@ - + - - - + + + + + + + + + + + + + + + BR-DE-CVD-02 + fatal + + + + + [BR-DE-CVD-02] Das Element + + "Tender or lot reference" (BT-17) muss übermittelt werden. + + + + + + + + + + BR-DE-CVD-01 + fatal + + + + + [BR-DE-CVD-01] Das Element + + "Contract reference" (BT-12) muss übermittelt werden. + + + + + + + + + + BR-DE-CVD-03 + fatal + + + + + [BR-DE-CVD-03] In einer Rechnung muss mindestens eine + + INVOICE LINE (BG-25) enthalten sein, in der der Scheme identifier von + + "Item classification identifier" (BT-158) den Wert 'CVD' und der + + "Item attribute name" (BT-160) den Wert 'cva' enthält. + + + + + + + + + + + + + + + BR-DE-CVD-06-a + fatal + + + + + [BR-DE-CVD-06-a] Wenn der Scheme identifier von + + "Item classification identifier" (BT-158) mit dem Wert 'CVD' angegeben ist, muss in derselben Rechnungszeile genau ein + + "Item attribute name" (BT-160) mit dem Wert 'cva' vorhanden sein. + + + + + + + + + + BR-DE-CVD-06-b + fatal + + + + + [BR-DE-CVD-06-b] Wenn + + "Item attribute name" (BT-160) mit dem Wert 'cva' angegeben ist, muss in derselben Rechnungszeile genau ein + + "Item classification identifier" (BT-158) mit dem Scheme identifier 'CVD' vorhanden sein. + + + + + + + + + + + + + + + BR-TMP-CVD-01 + fatal + + + + + [BR-TMP-CVD-01] Das Bildungsschema für + + "Item classification identifier" (BT-158) ist aus der Codeliste UNTDID 7143 zu wählen. + + + + + + + + + + BR-DE-CVD-04 + fatal + + + + + [BR-DE-CVD-04] Ein + + "Item classification identifier" (BT-158) mit dem Scheme identifier 'CVD' muss einen Wert aus der Liste der zulässigen Fahrzeugkategorien enthalten. + + + + + + + + + + + + + + + BR-DE-CVD-05 + fatal + + + + + [BR-DE-CVD-05] Wenn innerhalb von + + ITEM ATTRIBUTES (BG-32) der + + "Item attribute name" (BT-160) den Wert 'cva' hat, muss der + + "Item attribute value" (BT-161) einen der zulässigen Werte enthalten. + + + + + + + + + diff --git a/validator/src/test/java/org/mustangproject/validator/ZUGFeRDValidatorTest.java b/validator/src/test/java/org/mustangproject/validator/ZUGFeRDValidatorTest.java index ec938490..7bf2aca9 100644 --- a/validator/src/test/java/org/mustangproject/validator/ZUGFeRDValidatorTest.java +++ b/validator/src/test/java/org/mustangproject/validator/ZUGFeRDValidatorTest.java @@ -216,10 +216,10 @@ public class ZUGFeRDValidatorTest extends ResourceCase { assertThat(res).valueByXPath("count(//error)") .asInt() - .isEqualTo(2); + .isEqualTo(5); assertThat(res).valueByXPath("count(//warning)") .asInt() - .isEqualTo(3); + .isEqualTo(1); assertThat(res).valueByXPath("count(//notice)") .asInt() @@ -250,7 +250,7 @@ public class ZUGFeRDValidatorTest extends ResourceCase { assertThat(res).valueByXPath("count(//notice)") .asInt() - .isEqualTo(12); // 12 notices RE XRechnung 3.0 + .isEqualTo(9); // 9 notices RE XRechnung 3.0 assertThat(res).valueByXPath("/validation/summary/@status") .asString() .isEqualTo("valid");// expect to be valid because XR notices are, well, only notices diff --git a/validator/src/test/resources/CII_XRechnung_with_Peppol_violation.xml b/validator/src/test/resources/CII_XRechnung_with_Peppol_violation.xml index 8e023db5..71efa791 100644 --- a/validator/src/test/resources/CII_XRechnung_with_Peppol_violation.xml +++ b/validator/src/test/resources/CII_XRechnung_with_Peppol_violation.xml @@ -93,6 +93,9 @@ Stadt DE + + muster@example.com + diff --git a/validator/src/test/resources/validXRV30.xml b/validator/src/test/resources/validXRV30.xml index 8587992c..adffb992 100644 --- a/validator/src/test/resources/validXRV30.xml +++ b/validator/src/test/resources/validXRV30.xml @@ -89,6 +89,14 @@ S 7 + + + 20160101 + + + 20161231 + + 26.07 From cd712aae6703d9c8a9067eb5411ca5f1d1a67349 Mon Sep 17 00:00:00 2001 From: Daniel Luckas Date: Fri, 8 Aug 2025 10:17:26 +0200 Subject: [PATCH 37/40] Parsing exceptions of date strings does not break the whole XML parsing and sets the unparsable dates to null --- .../ZUGFeRD/ZUGFeRDInvoiceImporter.java | 87 ++++++++++++++----- 1 file changed, 66 insertions(+), 21 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java index 41f7b823..9f37ee0b 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java @@ -1,6 +1,5 @@ package org.mustangproject.ZUGFeRD; -import javax.xml.XMLConstants; import org.apache.commons.io.IOUtils; import org.apache.pdfbox.Loader; import org.apache.pdfbox.pdmodel.PDDocument; @@ -9,8 +8,21 @@ import org.apache.pdfbox.pdmodel.PDEmbeddedFilesNameTreeNode; import org.apache.pdfbox.pdmodel.common.PDNameTreeNode; import org.apache.pdfbox.pdmodel.common.filespecification.PDComplexFileSpecification; import org.apache.pdfbox.pdmodel.common.filespecification.PDEmbeddedFile; -import org.mustangproject.*; +import org.mustangproject.Allowance; +import org.mustangproject.BankDetails; +import org.mustangproject.CalculatedInvoice; +import org.mustangproject.Charge; +import org.mustangproject.DirectDebit; +import org.mustangproject.EStandard; import org.mustangproject.Exceptions.StructureException; +import org.mustangproject.FileAttachment; +import org.mustangproject.IncludedNote; +import org.mustangproject.Invoice; +import org.mustangproject.Item; +import org.mustangproject.ReferencedDocument; +import org.mustangproject.SchemedID; +import org.mustangproject.TradeParty; +import org.mustangproject.XMLTools; import org.mustangproject.util.NodeMap; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -19,11 +31,19 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; import org.xml.sax.SAXException; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.xpath.*; -import java.io.*; +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathConstants; +import javax.xml.xpath.XPathExpression; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; +import java.io.BufferedInputStream; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; import java.math.BigDecimal; import java.nio.charset.StandardCharsets; import java.nio.file.Files; @@ -31,7 +51,16 @@ import java.nio.file.Paths; import java.nio.file.StandardOpenOption; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Base64; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -127,7 +156,7 @@ public class ZUGFeRDInvoiceImporter { if (Arrays.equals(pad, pdfSignature)) { // we have a pdf - try(PDDocument doc = Loader.loadPDF(IOUtils.toByteArray(pdfStream))) { + try (PDDocument doc = Loader.loadPDF(IOUtils.toByteArray(pdfStream))) { // PDDocumentInformation info = doc.getDocumentInformation(); final PDDocumentNameDictionary names = new PDDocumentNameDictionary(doc.getDocumentCatalog()); //start @@ -175,7 +204,7 @@ public class ZUGFeRDInvoiceImporter { containsMeta = true; try { setRawXML(XMLTools.getBytesFromStream(pdfStream)); - } catch(ParseException e) { + } catch (ParseException e) { LOGGER.error("Failed to parse PDF", e); } @@ -209,19 +238,20 @@ public class ZUGFeRDInvoiceImporter { public boolean hasXMLFileAttachment() { return containsAXMLFileAttachment; } + /*** * sets th pdf attachments, and if a file is recognized (e.g. a factur-x.xml) triggers processing * @param names the Hashmap of String, PDComplexFileSpecification * @throws IOException */ private void extractFiles(Map names) throws IOException { - containsAXMLFileAttachment=false; + containsAXMLFileAttachment = false; for (final String alias : names.keySet()) { final PDComplexFileSpecification fileSpec = names.get(alias); final String filename = fileSpec.getFilename(); if (filename.toUpperCase().endsWith(".XML")) { - containsAXMLFileAttachment=true; + containsAXMLFileAttachment = true; } /** * filenames for invoice data (ZUGFeRD v1 and v2, Factur-X) @@ -523,7 +553,8 @@ public class ZUGFeRDInvoiceImporter { for (int issueDateChildIndex = 0; issueDateChildIndex < issueDateTimeChilds.getLength(); issueDateChildIndex++) { if ((issueDateTimeChilds.item(issueDateChildIndex).getLocalName() != null) && (issueDateTimeChilds.item(issueDateChildIndex).getLocalName().equals("DateTimeString"))) { - issueDate = new SimpleDateFormat("yyyyMMdd").parse(XMLTools.trimOrNull(issueDateTimeChilds.item(issueDateChildIndex))); + String issueDateString = XMLTools.trimOrNull(issueDateTimeChilds.item(issueDateChildIndex)); + issueDate = parseDate(issueDateString, "yyyyMMdd"); } } } @@ -582,15 +613,15 @@ public class ZUGFeRDInvoiceImporter { typeCode = extractString("/*[local-name()=\"Invoice\" or local-name()=\"CreditNote\"]/*[local-name()=\"InvoiceTypeCode\"]").trim(); String issueDateStr = extractString("/*[local-name()=\"Invoice\" or local-name()=\"CreditNote\"]/*[local-name()=\"IssueDate\"]").trim(); if (!issueDateStr.isEmpty()) { - issueDate = new SimpleDateFormat("yyyy-MM-dd").parse(issueDateStr); + issueDate = parseDate(issueDateStr, "yyyy-MM-dd"); } String dueDt = extractString("/*[local-name()=\"Invoice\" or local-name()=\"CreditNote\"]/*[local-name()=\"DueDate\"]").trim(); if (!dueDt.isEmpty()) { - dueDate = new SimpleDateFormat("yyyy-MM-dd").parse(dueDt); + dueDate = parseDate(dueDt, "yyyy-MM-dd"); } String deliveryDt = extractString("//*[local-name()=\"Delivery\"]/*[local-name()=\"ActualDeliveryDate\"]").trim(); if (!deliveryDt.isEmpty()) { - deliveryDate = new SimpleDateFormat("yyyy-MM-dd").parse(deliveryDt); + deliveryDate = parseDate(deliveryDt, "yyyy-MM-dd"); } } @@ -620,7 +651,8 @@ public class ZUGFeRDInvoiceImporter { for (int occurenceChildIndex = 0; occurenceChildIndex < occurenceChilds.getLength(); occurenceChildIndex++) { if ((occurenceChilds.item(occurenceChildIndex).getLocalName() != null) && (occurenceChilds.item(occurenceChildIndex).getLocalName().equals("DateTimeString"))) { - deliveryDate = new SimpleDateFormat("yyyyMMdd").parse(XMLTools.trimOrNull(occurenceChilds.item(occurenceChildIndex))); + String deliveryDateString = XMLTools.trimOrNull(occurenceChilds.item(occurenceChildIndex)); + deliveryDate = parseDate(deliveryDateString, "yyyyMMdd"); } } } @@ -714,7 +746,8 @@ public class ZUGFeRDInvoiceImporter { NodeList dueDateChilds = paymentTermChilds.item(paymentTermChildIndex).getChildNodes(); for (int dueDateChildIndex = 0; dueDateChildIndex < dueDateChilds.getLength(); dueDateChildIndex++) { if ((dueDateChilds.item(dueDateChildIndex).getLocalName() != null) && (dueDateChilds.item(dueDateChildIndex).getLocalName().equals("DateTimeString"))) { - dueDate = new SimpleDateFormat("yyyyMMdd").parse(XMLTools.trimOrNull(dueDateChilds.item(dueDateChildIndex))); + String dueDateString = XMLTools.trimOrNull(dueDateChilds.item(dueDateChildIndex)); + dueDate = parseDate(dueDateString, "yyyyMMdd"); } } } @@ -767,7 +800,7 @@ public class ZUGFeRDInvoiceImporter { if (BIC != null) { bd.setBIC(BIC); } - if (accountName!=null) { + if (accountName != null) { bd.setAccountName(accountName); } bankDetails.add(bd); @@ -803,7 +836,7 @@ public class ZUGFeRDInvoiceImporter { NodeList periodNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET); for (int periodChildIndex = 0; periodChildIndex < periodNodes.getLength(); periodChildIndex++) { - String localName=periodNodes.item(periodChildIndex).getLocalName(); + String localName = periodNodes.item(periodChildIndex).getLocalName(); if ((localName != null) && (periodNodes.item(periodChildIndex).getLocalName().equals("StartDate"))) { deliveryPeriodStart = XMLTools.trimOrNull(periodNodes.item(periodChildIndex)); } @@ -854,7 +887,7 @@ public class ZUGFeRDInvoiceImporter { } if (IBAN != null) { BankDetails bd = new BankDetails(IBAN); - if (accountName!=null) { + if (accountName != null) { bd.setAccountName(accountName); } bankDetails.add(bd); @@ -1004,7 +1037,7 @@ public class ZUGFeRDInvoiceImporter { } else if (chargeChildName.equals("ActualAmount") || chargeChildName.equals("Amount")) { chargeAmount = XMLTools.trimOrNull(chargeNodeChilds.item(chargeChildIndex)); - } else if (chargeChildName.equals("BasisAmount")) { + } else if (chargeChildName.equals("BasisAmount")) { basisAmount = XMLTools.trimOrNull(chargeNodeChilds.item(chargeChildIndex)); } else if (chargeChildName.equals("Reason") || chargeChildName.equals("AllowanceChargeReason")) { reason = XMLTools.trimOrNull(chargeNodeChilds.item(chargeChildIndex)); @@ -1119,6 +1152,18 @@ public class ZUGFeRDInvoiceImporter { } + private Date parseDate(String issueDateString, String datePattern) throws ParseException { + Date parsedDate = null; + if (issueDateString != null) { + try { + parsedDate = new SimpleDateFormat(datePattern).parse(issueDateString); + } catch (ParseException e) { + LOGGER.warn("Failed to parse date {} with pattern {}", issueDateString, datePattern, e); + } + } + return parsedDate; + } + protected Document getDocument() { return document; } @@ -1201,7 +1246,7 @@ public class ZUGFeRDInvoiceImporter { */ @Deprecated public List getFileAttachmentsXML() { - if (importedInvoice.getAdditionalReferencedDocuments()!=null) { + if (importedInvoice.getAdditionalReferencedDocuments() != null) { return new ArrayList<>(Arrays.asList(importedInvoice.getAdditionalReferencedDocuments())); } else { return new ArrayList<>(); @@ -1228,7 +1273,7 @@ public class ZUGFeRDInvoiceImporter { * sets the XML for the importer to parse * @param XML the UBL or CII */ - public void fromXML(String XML) throws ParseException{ + public void fromXML(String XML) throws ParseException { try { containsMeta = true; setRawXML(XML.getBytes(StandardCharsets.UTF_8)); From f4a4dd1a335e9a91b6b8b772b293cae9dda44ae3 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Mon, 11 Aug 2025 09:26:45 +0200 Subject: [PATCH 38/40] closes #821 --- .../org/mustangproject/ZUGFeRD/ValidationLogVisualizer.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ValidationLogVisualizer.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ValidationLogVisualizer.java index 7e7d8a17..17c3e1ea 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ValidationLogVisualizer.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ValidationLogVisualizer.java @@ -130,9 +130,6 @@ public class ValidationLogVisualizer { TransformerFactory factory = TransformerFactory.newInstance(); factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); - factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - factory.setFeature("http://xml.org/sax/features/external-general-entities", false); - factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); Transformer transformer = factory.newTransformer(); // identity transformer // Step 5: Setup input and output for XSLT transformation From 2454fe7c628acdc4eccb1abbc449692f8dd1f9e5 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Mon, 11 Aug 2025 09:27:09 +0200 Subject: [PATCH 39/40] closes #813 --- History.md | 7 ++++++- .../org/mustangproject/validator/ZUGFeRDValidator.java | 6 +----- .../org/mustangproject/validator/ZUGFeRDValidatorTest.java | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/History.md b/History.md index 917248dc..15d8b0ab 100644 --- a/History.md +++ b/History.md @@ -2,10 +2,15 @@ ======= - #893 Tradeparty globalID is not read from JSON - #902 Tests to use definted TZ (UTC) -- #905 Parse product level charges/discounts in UBL +- #905 Parse product level charges/discounts into JSON - #869 Import Account Holder returns SellerTradeParty.name instead of AccountHolder - #861 Multiple problems with Product.CountryOfOrigin - #908 Validation: Make clear when embedded file name is wrong +- #913 downgrade PDF/A errors to warnings +- #821 +- #911 +- #912 + 2.18.0 ======= diff --git a/validator/src/main/java/org/mustangproject/validator/ZUGFeRDValidator.java b/validator/src/main/java/org/mustangproject/validator/ZUGFeRDValidator.java index a64efdce..bb5e9576 100644 --- a/validator/src/main/java/org/mustangproject/validator/ZUGFeRDValidator.java +++ b/validator/src/main/java/org/mustangproject/validator/ZUGFeRDValidator.java @@ -204,10 +204,6 @@ public class ZUGFeRDValidator { context.clearCustomXML(); } - if ((isPDF) && (!pdfValidity)) { - context.setInvalid(); - } - } } catch (IrrecoverableValidationError | IOException irx) { LOGGER.info(irx.getMessage()); @@ -337,7 +333,7 @@ public class ZUGFeRDValidator { + " Signature:" + Signature + " Checksum:" + sha1Checksum + " Profile:" + context.getProfile() + " Version:" + context.getGeneration() + " Took:" + duration + "ms Errors:[" + context.getCSVResult() + "] ErrorIDs: [" + context.getCSVIDResult() + "]" + toBeAppended); - wasCompletelyValid = ((pdfValidity) && (xmlValidity)); + wasCompletelyValid = xmlValidity; return sw.toString(); } diff --git a/validator/src/test/java/org/mustangproject/validator/ZUGFeRDValidatorTest.java b/validator/src/test/java/org/mustangproject/validator/ZUGFeRDValidatorTest.java index ec938490..1cd6681e 100644 --- a/validator/src/test/java/org/mustangproject/validator/ZUGFeRDValidatorTest.java +++ b/validator/src/test/java/org/mustangproject/validator/ZUGFeRDValidatorTest.java @@ -31,7 +31,7 @@ public class ZUGFeRDValidatorTest extends ResourceCase { .isEqualTo("valid"); assertThat(res).valueByXPath("/validation/summary/@status") - .isEqualTo("invalid"); + .isEqualTo("valid"); tempFile = getResourceAsFile("validAvoir_FR_type380_BASICWL.pdf"); @@ -103,7 +103,7 @@ public class ZUGFeRDValidatorTest extends ResourceCase { .isEqualTo("valid"); assertThat(res).valueByXPath("/validation/summary/@status") - .isEqualTo("invalid"); + .isEqualTo("valid"); fileBytes = getResourceAsByteArray("validAvoir_FR_type380_BASICWL.pdf"); From 975ae92673d5cca0897534a3807402a54eae232e Mon Sep 17 00:00:00 2001 From: jstaerk Date: Mon, 11 Aug 2025 09:35:10 +0200 Subject: [PATCH 40/40] updated history --- History.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/History.md b/History.md index 15d8b0ab..732fe79e 100644 --- a/History.md +++ b/History.md @@ -1,4 +1,4 @@ -2.18.1 +2.19.0 ======= - #893 Tradeparty globalID is not read from JSON - #902 Tests to use definted TZ (UTC) @@ -6,6 +6,7 @@ - #869 Import Account Holder returns SellerTradeParty.name instead of AccountHolder - #861 Multiple problems with Product.CountryOfOrigin - #908 Validation: Make clear when embedded file name is wrong +- #909 - #913 downgrade PDF/A errors to warnings - #821 - #911