Merge branch 'ZUGFeRD:master' into fix-hyphenation
This commit is contained in:
11
History.md
11
History.md
@@ -1,7 +1,10 @@
|
|||||||
- #678
|
2.16.1
|
||||||
- #679
|
=======
|
||||||
- #681
|
2025-01-21
|
||||||
- #689
|
- #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
|
- be able to set detailedDeliveryPeriodFrom, detailedDeliveryPeriodTo MS188
|
||||||
- updated verapdf from 1.26.1 to 1.26.2
|
- updated verapdf from 1.26.1 to 1.26.2
|
||||||
- cashDiscount JSON now corrently ignores values for cii and xr methods
|
- cashDiscount JSON now corrently ignores values for cii and xr methods
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mustangproject</groupId>
|
<groupId>org.mustangproject</groupId>
|
||||||
<artifactId>core</artifactId>
|
<artifactId>core</artifactId>
|
||||||
<version>2.16.1-SNAPSHOT</version>
|
<version>2.16.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.mustangproject</groupId>
|
<groupId>org.mustangproject</groupId>
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
should also work for XRechnung/CII.
|
should also work for XRechnung/CII.
|
||||||
</name>
|
</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>2.16.1-SNAPSHOT</version>
|
<version>2.16.2-SNAPSHOT</version>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<maven.compiler.compilerVersion>11</maven.compiler.compilerVersion>
|
<maven.compiler.compilerVersion>11</maven.compiler.compilerVersion>
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mustangproject</groupId>
|
<groupId>org.mustangproject</groupId>
|
||||||
<artifactId>validator</artifactId>
|
<artifactId>validator</artifactId>
|
||||||
<version>2.16.1-SNAPSHOT</version>
|
<version>2.16.2-SNAPSHOT</version>
|
||||||
<!-- prototypes of new mustangproject versions can be installed by referring to them and installed to the local repo from a jar file with
|
<!-- prototypes of new mustangproject versions can be installed by referring to them and installed to the local repo from a jar file with
|
||||||
mvn install:install-file -Dfile=mustang-1.5.4-SNAPSHOT.jar -DgroupId=org.mustangproject.ZUGFeRD -DartifactId=mustang -Dversion=1.5.4 -Dpackaging=jar -DgeneratePom=true
|
mvn install:install-file -Dfile=mustang-1.5.4-SNAPSHOT.jar -DgroupId=org.mustangproject.ZUGFeRD -DartifactId=mustang -Dversion=1.5.4 -Dpackaging=jar -DgeneratePom=true
|
||||||
-->
|
-->
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mustangproject</groupId>
|
<groupId>org.mustangproject</groupId>
|
||||||
<artifactId>core</artifactId>
|
<artifactId>core</artifactId>
|
||||||
<version>2.16.1-SNAPSHOT</version>
|
<version>2.16.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.mustangproject</groupId>
|
<groupId>org.mustangproject</groupId>
|
||||||
<artifactId>library</artifactId>
|
<artifactId>library</artifactId>
|
||||||
<version>2.16.1-SNAPSHOT</version>
|
<version>2.16.2-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<name>Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII)</name>
|
<name>Library to write, read and validate e-invoices (Factur-X, ZUGFeRD, Order-X, XRechnung/CII)</name>
|
||||||
<description>FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT
|
<description>FOSS Java library to read, write and validate european electronic invoices and orders in the UN/CEFACT
|
||||||
|
|||||||
@@ -125,8 +125,8 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
// Reading ZUGFeRD
|
// Reading ZUGFeRD
|
||||||
assertEquals("Bei Spiel GmbH", invoice.getOwnOrganisationName());
|
assertEquals("Bei Spiel GmbH", invoice.getOwnOrganisationName());
|
||||||
assertEquals(3, invoice.getZFItems().length);
|
assertEquals(3, invoice.getZFItems().length);
|
||||||
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(),"Something");
|
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().get(0).getContent(), "Something");
|
||||||
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().size(),1);
|
assertEquals(invoice.getZFItems()[0].getNotesWithSubjectCode().size(), 1);
|
||||||
assertEquals("400", invoice.getZFItems()[1].getQuantity().toString());
|
assertEquals("400", invoice.getZFItems()[1].getQuantity().toString());
|
||||||
assertEquals("Zahlbar ohne Abzug bis zum 30.05.2017", invoice.getPaymentTermDescription());
|
assertEquals("Zahlbar ohne Abzug bis zum 30.05.2017", invoice.getPaymentTermDescription());
|
||||||
assertEquals("AB321", invoice.getReferenceNumber());
|
assertEquals("AB321", invoice.getReferenceNumber());
|
||||||
@@ -245,7 +245,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
}
|
}
|
||||||
assertFalse(hasExceptions);
|
assertFalse(hasExceptions);
|
||||||
TransactionCalculator tc = new TransactionCalculator(invoice);
|
TransactionCalculator tc = new TransactionCalculator(invoice);
|
||||||
assertEquals(new BigDecimal("18.33"), tc.getGrandTotal());
|
assertEquals(new BigDecimal("19.52"), tc.getGrandTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testBasisQuantityImport() {
|
public void testBasisQuantityImport() {
|
||||||
@@ -264,6 +264,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
assertEquals(new BigDecimal("337.60"), tc.getGrandTotal());
|
assertEquals(new BigDecimal("337.60"), tc.getGrandTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void testAllowancesChargesImport() {
|
public void testAllowancesChargesImport() {
|
||||||
|
|
||||||
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter("./target/testout-ZF2PushChargesAllowances.pdf");
|
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter("./target/testout-ZF2PushChargesAllowances.pdf");
|
||||||
@@ -286,10 +287,10 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
|
|
||||||
ZUGFeRDImporter zii = new ZUGFeRDImporter();
|
ZUGFeRDImporter zii = new ZUGFeRDImporter();
|
||||||
|
|
||||||
int version=-1;
|
int version = -1;
|
||||||
try {
|
try {
|
||||||
zii.fromXML(new String(Files.readAllBytes(Paths.get("./target/testout-XR-Edge.xml")), StandardCharsets.UTF_8));
|
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) {
|
} catch (IOException e) {
|
||||||
hasExceptions = true;
|
hasExceptions = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -305,13 +306,12 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
assertFalse(hasExceptions);
|
assertFalse(hasExceptions);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TransactionCalculator tc = new TransactionCalculator(invoice);
|
TransactionCalculator tc = new TransactionCalculator(invoice);
|
||||||
assertEquals(new BigDecimal("1.00"), tc.getGrandTotal());
|
assertEquals(new BigDecimal("1.00"), tc.getGrandTotal());
|
||||||
|
|
||||||
assertEquals(version,2);
|
assertEquals(version, 2);
|
||||||
assertTrue(new BigDecimal("1").compareTo(invoice.getZFItems()[0].getQuantity()) == 0);
|
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(new BigDecimal("1").compareTo(lc.getItemTotalNetAmount()) == 0);
|
||||||
|
|
||||||
assertTrue(invoice.getTradeSettlement().length == 1);
|
assertTrue(invoice.getTradeSettlement().length == 1);
|
||||||
@@ -357,7 +357,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(new FileInputStream(CIIinputFile));
|
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(new FileInputStream(CIIinputFile));
|
||||||
Invoice i = zii.extractInvoice();
|
Invoice i = zii.extractInvoice();
|
||||||
|
|
||||||
assertEquals("DE21860000000086001055", i.getSender().getBankDetails().get(0).getIBAN());
|
assertEquals("DE21860000000086001055", i.getRecipient().getBankDetails().get(0).getIBAN());
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
||||||
String jsonArray = mapper.writeValueAsString(i);
|
String jsonArray = mapper.writeValueAsString(i);
|
||||||
@@ -430,15 +430,15 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
CalculatedInvoice invoice = new CalculatedInvoice();
|
CalculatedInvoice invoice = new CalculatedInvoice();
|
||||||
importer.extractInto(invoice);
|
importer.extractInto(invoice);
|
||||||
|
|
||||||
boolean isBD=invoice.getTotalPrepaidAmount() instanceof BigDecimal;
|
boolean isBD = invoice.getTotalPrepaidAmount() instanceof BigDecimal;
|
||||||
assertTrue(isBD);
|
assertTrue(isBD);
|
||||||
BigDecimal expectedPrepaid=new BigDecimal(50);
|
BigDecimal expectedPrepaid = new BigDecimal(50);
|
||||||
BigDecimal expectedLineTotal=new BigDecimal("180.76");
|
BigDecimal expectedLineTotal = new BigDecimal("180.76");
|
||||||
BigDecimal expectedDue=new BigDecimal("147.65");
|
BigDecimal expectedDue = new BigDecimal("147.65");
|
||||||
if (isBD) {
|
if (isBD) {
|
||||||
BigDecimal amread=invoice.getTotalPrepaidAmount();
|
BigDecimal amread = invoice.getTotalPrepaidAmount();
|
||||||
BigDecimal importedLineTotal=invoice.getLineTotalAmount();
|
BigDecimal importedLineTotal = invoice.getLineTotalAmount();
|
||||||
BigDecimal importedDuePayable=invoice.getDuePayable();
|
BigDecimal importedDuePayable = invoice.getDuePayable();
|
||||||
assertTrue(amread.compareTo(expectedPrepaid) == 0);
|
assertTrue(amread.compareTo(expectedPrepaid) == 0);
|
||||||
assertTrue(importedLineTotal.compareTo(expectedLineTotal) == 0);
|
assertTrue(importedLineTotal.compareTo(expectedLineTotal) == 0);
|
||||||
assertTrue(importedDuePayable.compareTo(expectedDue) == 0);
|
assertTrue(importedDuePayable.compareTo(expectedDue) == 0);
|
||||||
@@ -475,19 +475,19 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
|||||||
|
|
||||||
ZUGFeRDInvoiceImporter importer = new ZUGFeRDInvoiceImporter(new FileInputStream(inputFile));
|
ZUGFeRDInvoiceImporter importer = new ZUGFeRDInvoiceImporter(new FileInputStream(inputFile));
|
||||||
Invoice invoice = importer.extractInvoice();
|
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
|
// IBAN belongs to recipient in invoice with sepa debit
|
||||||
assertEquals("DE21860000000086001055",invoice.getRecipient().getBankDetails().get(0).getIBAN());
|
assertEquals("DE21860000000086001055", invoice.getRecipient().getBankDetails().get(0).getIBAN());
|
||||||
assertEquals(0,invoice.getSender().getBankDetails().size());
|
assertEquals(0, invoice.getSender().getBankDetails().size());
|
||||||
|
|
||||||
inputFile = getResourceAsFile("factur-x.xml");
|
inputFile = getResourceAsFile("factur-x.xml");
|
||||||
|
|
||||||
importer = new ZUGFeRDInvoiceImporter(new FileInputStream(inputFile));
|
importer = new ZUGFeRDInvoiceImporter(new FileInputStream(inputFile));
|
||||||
invoice = importer.extractInvoice();
|
invoice = importer.extractInvoice();
|
||||||
assertEquals(1,invoice.getSender().getBankDetails().size());
|
assertEquals(1, invoice.getSender().getBankDetails().size());
|
||||||
// IBAN belongs to sender in normal invoice
|
// IBAN belongs to sender in normal invoice
|
||||||
assertEquals("DE88200800000970375700",invoice.getSender().getBankDetails().get(0).getIBAN());
|
assertEquals("DE88200800000970375700", invoice.getSender().getBankDetails().get(0).getIBAN());
|
||||||
assertEquals(0,invoice.getRecipient().getBankDetails().size());
|
assertEquals(0, invoice.getRecipient().getBankDetails().size());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -3,7 +3,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.mustangproject</groupId>
|
<groupId>org.mustangproject</groupId>
|
||||||
<artifactId>core</artifactId>
|
<artifactId>core</artifactId>
|
||||||
<version>2.16.1-SNAPSHOT</version> <packaging>pom</packaging>
|
<version>2.16.2-SNAPSHOT</version> <packaging>pom</packaging>
|
||||||
<name>Mustang</name>
|
<name>Mustang</name>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mustangproject</groupId>
|
<groupId>org.mustangproject</groupId>
|
||||||
<artifactId>core</artifactId>
|
<artifactId>core</artifactId>
|
||||||
<version>2.16.1-SNAPSHOT</version>
|
<version>2.16.2-SNAPSHOT</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.mustangproject</groupId>
|
<groupId>org.mustangproject</groupId>
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<name>Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung)</name>
|
<name>Library to validate e-invoices (ZUGFeRD, Factur-X and Xrechnung)</name>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>2.16.1-SNAPSHOT</version>
|
<version>2.16.2-SNAPSHOT</version>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<!-- for jargs -->
|
<!-- for jargs -->
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>${project.groupId}</groupId>
|
<groupId>${project.groupId}</groupId>
|
||||||
<artifactId>library</artifactId>
|
<artifactId>library</artifactId>
|
||||||
<version>2.16.1-SNAPSHOT</version>
|
<version>2.16.2-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dom4j</groupId>
|
<groupId>org.dom4j</groupId>
|
||||||
|
|||||||
Reference in New Issue
Block a user