additional minimum test, require toolchains.xml only for release, not for any build
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
- allow Bank credentials without BIC
|
- allow Bank credentials without BIC
|
||||||
- allow minimum profile without delivery date
|
- allow minimum profile without delivery date
|
||||||
- allow prepaid amount in invoice class
|
- allow prepaid amount in invoice class
|
||||||
|
- toolchain.xml now only required on `mvn release:release` not already on `mvn package`
|
||||||
|
|
||||||
2.6.0 "Joyeux Noël"
|
2.6.0 "Joyeux Noël"
|
||||||
=======
|
=======
|
||||||
|
|||||||
@@ -100,26 +100,6 @@
|
|||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-toolchains-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>toolchain</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<toolchains>
|
|
||||||
<jdk>
|
|
||||||
<version>8</version>
|
|
||||||
<vendor>adopt</vendor>
|
|
||||||
</jdk>
|
|
||||||
</toolchains>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
@@ -199,6 +179,43 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
<profiles>
|
||||||
|
<profile> <!-- enforce building binaries with Java 1.8 for Maven Central, otherwise using them e.g. as jar will
|
||||||
|
throw a version exception, triggered automatically on mvn release:release (hopefully) and requires an according
|
||||||
|
~/.m2/toolchains.xml file, @see doc/development_documentation.md -->
|
||||||
|
<id>release-sign-artifacts</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>performRelease</name>
|
||||||
|
<value>true</value>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-toolchains-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>toolchain</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<toolchains>
|
||||||
|
<jdk>
|
||||||
|
<version>8</version>
|
||||||
|
<vendor>adopt</vendor>
|
||||||
|
</jdk>
|
||||||
|
</toolchains>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
<licenses>
|
<licenses>
|
||||||
<license>
|
<license>
|
||||||
<name>Apache License, Version 2.0</name>
|
<name>Apache License, Version 2.0</name>
|
||||||
|
|||||||
@@ -155,26 +155,6 @@
|
|||||||
<target>8</target>
|
<target>8</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-toolchains-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>toolchain</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<toolchains>
|
|
||||||
<jdk>
|
|
||||||
<version>8</version>
|
|
||||||
<vendor>adopt</vendor>
|
|
||||||
</jdk>
|
|
||||||
</toolchains>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
@@ -241,6 +221,41 @@
|
|||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile> <!-- enforce building binaries with Java 1.8 for Maven Central, otherwise using them e.g. as jar will throw a version exception-->
|
||||||
|
<id>release-sign-artifacts</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>performRelease</name>
|
||||||
|
<value>true</value>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-toolchains-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>toolchain</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<toolchains>
|
||||||
|
<jdk>
|
||||||
|
<version>8</version>
|
||||||
|
<vendor>adopt</vendor>
|
||||||
|
</jdk>
|
||||||
|
</toolchains>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
<mailingLists>
|
<mailingLists>
|
||||||
<mailingList>
|
<mailingList>
|
||||||
<name>User List</name>
|
<name>User List</name>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class ProfilesMinimumBasicWLTest extends TestCase {
|
|||||||
|
|
||||||
final String TARGET_PDF_FX_MINIMUM = "./target/testout-Minimum.pdf";
|
final String TARGET_PDF_FX_MINIMUM = "./target/testout-Minimum.pdf";
|
||||||
|
|
||||||
public void testMinimumExport() {
|
public void testMinimumCreditNote() {
|
||||||
String ownNumber = "NUMFACTURE";
|
String ownNumber = "NUMFACTURE";
|
||||||
String ownBIC = "COBADEFFXXX";
|
String ownBIC = "COBADEFFXXX";
|
||||||
String ownIBAN = "DE88200800000970375700";
|
String ownIBAN = "DE88200800000970375700";
|
||||||
@@ -95,4 +95,58 @@ public class ProfilesMinimumBasicWLTest extends TestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void testMinimumInvoice() {
|
||||||
|
String ownNumber = "NUMFACTURE";
|
||||||
|
String ownBIC = "COBADEFFXXX";
|
||||||
|
String ownIBAN = "DE88200800000970375700";
|
||||||
|
String ownOrgName = "ME";
|
||||||
|
|
||||||
|
// the writing part
|
||||||
|
try (InputStream SOURCE_PDF = this.getClass()
|
||||||
|
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||||
|
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile("Minimum").load(SOURCE_PDF)) {
|
||||||
|
/***
|
||||||
|
* this is a classical example of a french invoice (very low profile, siret number) and an attempt to answer stackoverflow (!)
|
||||||
|
* https://stackoverflow.com/questions/72450066/creating-a-min-basic-and-basic-wl-factur-x-using-mustang
|
||||||
|
*/
|
||||||
|
|
||||||
|
TradeParty recipient = new TradeParty().setName("Client").setCountry("FR");
|
||||||
|
String siret="0815";
|
||||||
|
String sirenTypeCode="0002";
|
||||||
|
recipient.setLegalOrganisation(new LegalOrganisation(siret,sirenTypeCode));
|
||||||
|
Invoice i = new Invoice()
|
||||||
|
.setIssueDate(new Date())
|
||||||
|
.setDueDate(new Date())
|
||||||
|
.setSender(
|
||||||
|
new TradeParty().setName(ownOrgName).setCountry("FR")
|
||||||
|
.addBankDetails(new BankDetails(ownIBAN)))
|
||||||
|
.setRecipient(recipient)
|
||||||
|
.setNumber(ownNumber).setTotalPrepaidAmount(new BigDecimal("1"))
|
||||||
|
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), new BigDecimal(123), new BigDecimal(1)));
|
||||||
|
ze.setTransaction(i);
|
||||||
|
ze.export(TARGET_PDF_FX_MINIMUM);
|
||||||
|
|
||||||
|
// check for pdf-a schema extension
|
||||||
|
// assertFalse(pdfContent.indexOf("<zf:ConformanceLevel>EN 16931</zf:ConformanceLevel>") == -1);
|
||||||
|
// assertFalse(pdfContent.indexOf("<pdfaSchema:prefix>zf</pdfaSchema:prefix>") == -1);
|
||||||
|
// assertFalse(pdfContent.indexOf("urn:zugferd:pdfa:CrossIndustryDocument:invoice:2p0#") == -1);
|
||||||
|
|
||||||
|
} catch (IOException e) {
|
||||||
|
fail("IOException should not happen in testMinimumExport");
|
||||||
|
}
|
||||||
|
|
||||||
|
// now check the contents (like MustangReaderTest)
|
||||||
|
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF_FX_MINIMUM);
|
||||||
|
|
||||||
|
// Reading ZUGFeRD
|
||||||
|
assertEquals("145.37",zi.getAmount());
|
||||||
|
// assertEquals(zi.getBIC(), ownBIC);
|
||||||
|
// assertEquals(zi.getIBAN(), ownIBAN);
|
||||||
|
assertEquals(ownOrgName, zi.getHolder());
|
||||||
|
// assertEquals(zi.getForeignReference(), ownNumber);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -165,26 +165,6 @@
|
|||||||
</archive>
|
</archive>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-toolchains-plugin</artifactId>
|
|
||||||
<version>3.1.0</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<goals>
|
|
||||||
<goal>toolchain</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
<configuration>
|
|
||||||
<toolchains>
|
|
||||||
<jdk>
|
|
||||||
<version>8</version>
|
|
||||||
<vendor>adopt</vendor>
|
|
||||||
</jdk>
|
|
||||||
</toolchains>
|
|
||||||
</configuration>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
@@ -299,7 +279,43 @@
|
|||||||
</developer>
|
</developer>
|
||||||
</developers>
|
</developers>
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile> <!-- enforce building binaries with Java 1.8 for Maven Central, otherwise using them e.g. as jar will
|
||||||
|
throw a version exception, triggered automatically on mvn release:release (hopefully) and requires an according
|
||||||
|
~/.m2/toolchains.xml file, @see doc/development_documentation.md -->
|
||||||
|
<id>release-sign-artifacts</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>performRelease</name>
|
||||||
|
<value>true</value>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-toolchains-plugin</artifactId>
|
||||||
|
<version>3.1.0</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>toolchain</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
<configuration>
|
||||||
|
<toolchains>
|
||||||
|
<jdk>
|
||||||
|
<version>8</version>
|
||||||
|
<vendor>adopt</vendor>
|
||||||
|
</jdk>
|
||||||
|
</toolchains>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</profile>
|
||||||
|
<profile> <!-- build the intermediate XSLT files from schematron takes 30min+ and is only required if there actually is a change in the schematron,
|
||||||
|
-> invoke manually with commandline -P generateXSLTFromSchematron on demand -->
|
||||||
<id>generateXSLTFromSchematron</id>
|
<id>generateXSLTFromSchematron</id>
|
||||||
<activation>
|
<activation>
|
||||||
<activeByDefault>false</activeByDefault>
|
<activeByDefault>false</activeByDefault>
|
||||||
|
|||||||
Reference in New Issue
Block a user