From f5a4cb3a2c7fd53671a503ca845d942db39c41ba Mon Sep 17 00:00:00 2001 From: jstaerk Date: Mon, 20 Jan 2025 13:51:52 +0100 Subject: [PATCH 1/4] corrected tests --- .../ZUGFeRD/ZF2ZInvoiceImporterTest.java | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java index 02985e61..6b50de4e 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java @@ -125,8 +125,8 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { // Reading ZUGFeRD assertEquals("Bei Spiel GmbH", invoice.getOwnOrganisationName()); assertEquals(3, invoice.getZFItems().length); - assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(),"Something"); - assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().size(),1); + assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(), "Something"); + assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().size(), 1); assertEquals("400", invoice.getZFItems()[1].getQuantity().toString()); assertEquals("Zahlbar ohne Abzug bis zum 30.05.2017", invoice.getPaymentTermDescription()); assertEquals("AB321", invoice.getReferenceNumber()); @@ -245,7 +245,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { } assertFalse(hasExceptions); TransactionCalculator tc = new TransactionCalculator(invoice); - assertEquals(new BigDecimal("18.33"), tc.getGrandTotal()); + assertEquals(new BigDecimal("19.52"), tc.getGrandTotal()); } public void testBasisQuantityImport() { @@ -264,6 +264,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { assertEquals(new BigDecimal("337.60"), tc.getGrandTotal()); } + public void testAllowancesChargesImport() { ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter("./target/testout-ZF2PushChargesAllowances.pdf"); @@ -286,10 +287,10 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { ZUGFeRDImporter zii = new ZUGFeRDImporter(); - int version=-1; + int version = -1; try { zii.fromXML(new String(Files.readAllBytes(Paths.get("./target/testout-XR-Edge.xml")), StandardCharsets.UTF_8)); - version=zii.getVersion(); + version = zii.getVersion(); } catch (IOException e) { hasExceptions = true; } catch (Exception e) { @@ -305,13 +306,12 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { assertFalse(hasExceptions); - TransactionCalculator tc = new TransactionCalculator(invoice); assertEquals(new BigDecimal("1.00"), tc.getGrandTotal()); - assertEquals(version,2); + assertEquals(version, 2); assertTrue(new BigDecimal("1").compareTo(invoice.getZFItems()[0].getQuantity()) == 0); - LineCalculator lc=new LineCalculator(invoice.getZFItems()[0]); + LineCalculator lc = new LineCalculator(invoice.getZFItems()[0]); assertTrue(new BigDecimal("1").compareTo(lc.getItemTotalNetAmount()) == 0); assertTrue(invoice.getTradeSettlement().length == 1); @@ -357,7 +357,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(new FileInputStream(CIIinputFile)); Invoice i = zii.extractInvoice(); - assertEquals("DE21860000000086001055", i.getSender().getBankDetails().get(0).getIBAN()); + assertEquals("DE21860000000086001055", i.getRecipient().getBankDetails().get(0).getIBAN()); ObjectMapper mapper = new ObjectMapper(); String jsonArray = mapper.writeValueAsString(i); @@ -430,15 +430,15 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { CalculatedInvoice invoice = new CalculatedInvoice(); importer.extractInto(invoice); - boolean isBD=invoice.getTotalPrepaidAmount() instanceof BigDecimal; + boolean isBD = invoice.getTotalPrepaidAmount() instanceof BigDecimal; assertTrue(isBD); - BigDecimal expectedPrepaid=new BigDecimal(50); - BigDecimal expectedLineTotal=new BigDecimal("180.76"); - BigDecimal expectedDue=new BigDecimal("147.65"); + BigDecimal expectedPrepaid = new BigDecimal(50); + BigDecimal expectedLineTotal = new BigDecimal("180.76"); + BigDecimal expectedDue = new BigDecimal("147.65"); if (isBD) { - BigDecimal amread=invoice.getTotalPrepaidAmount(); - BigDecimal importedLineTotal=invoice.getLineTotalAmount(); - BigDecimal importedDuePayable=invoice.getDuePayable(); + BigDecimal amread = invoice.getTotalPrepaidAmount(); + BigDecimal importedLineTotal = invoice.getLineTotalAmount(); + BigDecimal importedDuePayable = invoice.getDuePayable(); assertTrue(amread.compareTo(expectedPrepaid) == 0); assertTrue(importedLineTotal.compareTo(expectedLineTotal) == 0); assertTrue(importedDuePayable.compareTo(expectedDue) == 0); @@ -475,19 +475,19 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { ZUGFeRDInvoiceImporter importer = new ZUGFeRDInvoiceImporter(new FileInputStream(inputFile)); Invoice invoice = importer.extractInvoice(); - assertEquals(1,invoice.getRecipient().getBankDetails().size()); + assertEquals(1, invoice.getRecipient().getBankDetails().size()); // IBAN belongs to recipient in invoice with sepa debit - assertEquals("DE21860000000086001055",invoice.getRecipient().getBankDetails().get(0).getIBAN()); - assertEquals(0,invoice.getSender().getBankDetails().size()); + assertEquals("DE21860000000086001055", invoice.getRecipient().getBankDetails().get(0).getIBAN()); + assertEquals(0, invoice.getSender().getBankDetails().size()); inputFile = getResourceAsFile("factur-x.xml"); importer = new ZUGFeRDInvoiceImporter(new FileInputStream(inputFile)); invoice = importer.extractInvoice(); - assertEquals(1,invoice.getSender().getBankDetails().size()); + assertEquals(1, invoice.getSender().getBankDetails().size()); // IBAN belongs to sender in normal invoice - assertEquals("DE88200800000970375700",invoice.getSender().getBankDetails().get(0).getIBAN()); - assertEquals(0,invoice.getRecipient().getBankDetails().size()); + assertEquals("DE88200800000970375700", invoice.getSender().getBankDetails().get(0).getIBAN()); + assertEquals(0, invoice.getRecipient().getBankDetails().size()); } From ef97effec065739018fad7194cb320bdf65b88a0 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 21 Jan 2025 13:08:02 +0100 Subject: [PATCH 2/4] updated history --- History.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/History.md b/History.md index c122d89b..c3afba03 100644 --- a/History.md +++ b/History.md @@ -1,7 +1,10 @@ -- #678 -- #679 -- #681 -- #689 +2.16.1 +======= +2025-01-21 +- #678 some ubl creditnote attributes are not parsed +- #679 validation of a XR does not ignore whitespace +- #681 IBAN assigned to invoice sender not recipient on direct debit +- #689 incorrect element order when both charge reason and reasoncode are specified - be able to set detailedDeliveryPeriodFrom, detailedDeliveryPeriodTo MS188 - updated verapdf from 1.26.1 to 1.26.2 - cashDiscount JSON now corrently ignores values for cii and xr methods From e4915c578cb72c7e88b2336e50a38cbaeb290def Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 21 Jan 2025 13:12:41 +0100 Subject: [PATCH 3/4] [maven-release-plugin] prepare release core-2.16.1 --- 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 9d83688f..0504de84 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.16.1-SNAPSHOT + 2.16.1 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.16.1-SNAPSHOT + 2.16.1 UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.16.1-SNAPSHOT + 2.16.1 diff --git a/library/pom.xml b/library/pom.xml index 81a1716f..33154746 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.16.1-SNAPSHOT + 2.16.1 4.0.0 org.mustangproject library - 2.16.1-SNAPSHOT + 2.16.1 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.16.1 diff --git a/pom.xml b/pom.xml index 03f326a5..9d089f57 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.16.1-SNAPSHOT pom + 2.16.1 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.16.1 diff --git a/validator/pom.xml b/validator/pom.xml index 6ceb0dd3..16498b6e 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.16.1-SNAPSHOT + 2.16.1 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.16.1-SNAPSHOT + 2.16.1 @@ -38,7 +38,7 @@ ${project.groupId} library - 2.16.1-SNAPSHOT + 2.16.1 org.dom4j From 331c05857b65b26efab44fb26afd2b7fdcd6a2e9 Mon Sep 17 00:00:00 2001 From: jstaerk Date: Tue, 21 Jan 2025 13:12:43 +0100 Subject: [PATCH 4/4] [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 0504de84..d5b924e9 100644 --- a/Mustang-CLI/pom.xml +++ b/Mustang-CLI/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.16.1 + 2.16.2-SNAPSHOT 4.0.0 org.mustangproject @@ -12,7 +12,7 @@ should also work for XRechnung/CII. jar - 2.16.1 + 2.16.2-SNAPSHOT UTF-8 11 @@ -23,7 +23,7 @@ org.mustangproject validator - 2.16.1 + 2.16.2-SNAPSHOT diff --git a/library/pom.xml b/library/pom.xml index 33154746..6045292a 100644 --- a/library/pom.xml +++ b/library/pom.xml @@ -3,13 +3,13 @@ org.mustangproject core - 2.16.1 + 2.16.2-SNAPSHOT 4.0.0 org.mustangproject library - 2.16.1 + 2.16.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 @@ -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.16.1 + core-2.3.2 diff --git a/pom.xml b/pom.xml index 9d089f57..7346b012 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.mustangproject core - 2.16.1 pom + 2.16.2-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.16.1 + core-2.3.2 diff --git a/validator/pom.xml b/validator/pom.xml index 16498b6e..6c94fd9e 100644 --- a/validator/pom.xml +++ b/validator/pom.xml @@ -3,7 +3,7 @@ org.mustangproject core - 2.16.1 + 2.16.2-SNAPSHOT 4.0.0 org.mustangproject @@ -11,7 +11,7 @@ Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung) jar - 2.16.1 + 2.16.2-SNAPSHOT @@ -38,7 +38,7 @@ ${project.groupId} library - 2.16.1 + 2.16.2-SNAPSHOT org.dom4j