Merge remote-tracking branch 'remotes/origin/master'

This commit is contained in:
Sebastian Sieber
2021-01-20 10:51:46 +01:00
7 changed files with 70 additions and 28 deletions

View File

@@ -1,8 +1,12 @@
2.1.0 2.1.0
======= =======
2020-01-19
- support CII to UBL conversion (thanks to https://github.com/phax/en16931-cii2ubl)
- make IExportableTransaction.getZFAllowances() getZFCharges() and getZFLogisticsServiceCharges() and item.getItemAllowances, item.getItemCharges optional, correct getCurrency optionality
make IZUGFeRDExportableTradeParty name id zip location street mandatory
- fixed a charge/allowance rounding error #212 - fixed a charge/allowance rounding error #212
- Corrected intra community supply tax exemption category code - Corrected intra community supply tax exemption category code
- removal of Tradeparty.getZip in favor of getZIP (as it's also setZIP) to avoid jackson errors
2.0.3 2.0.3
======= =======

View File

@@ -3,14 +3,14 @@
<parent> <parent>
<groupId>org.mustangproject</groupId> <groupId>org.mustangproject</groupId>
<artifactId>core</artifactId> <artifactId>core</artifactId>
<version>2.0.4-SNAPSHOT</version> <version>2.1.1-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.mustangproject</groupId> <groupId>org.mustangproject</groupId>
<artifactId>Mustang-CLI</artifactId> <artifactId>Mustang-CLI</artifactId>
<name>e-invoices commandline tool, allowing to create(embed), split and validate Factur-X/ZUGFeRD files. Validation should also work for XRechnung/CII. </name> <name>e-invoices commandline tool, allowing to create(embed), split and validate Factur-X/ZUGFeRD files. Validation should also work for XRechnung/CII. </name>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>2.0.4-SNAPSHOT</version> <version>2.1.1-SNAPSHOT</version>
<repositories> <repositories>
<repository> <repository>
<!-- for jargs --> <!-- for jargs -->
@@ -31,7 +31,7 @@
<dependency> <dependency>
<groupId>org.mustangproject</groupId> <groupId>org.mustangproject</groupId>
<artifactId>validator</artifactId> <artifactId>validator</artifactId>
<version>2.0.4-SNAPSHOT</version> <version>2.1.1-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
--> -->

View File

@@ -20,6 +20,7 @@ package org.mustangproject.commandline;
import com.sanityinc.jargs.CmdLineParser; import com.sanityinc.jargs.CmdLineParser;
import com.sanityinc.jargs.CmdLineParser.Option; import com.sanityinc.jargs.CmdLineParser.Option;
import org.mustangproject.CII.CIIToUBL;
import org.mustangproject.ZUGFeRD.*; import org.mustangproject.ZUGFeRD.*;
import org.mustangproject.validator.Validator; import org.mustangproject.validator.Validator;
import org.mustangproject.validator.ZUGFeRDValidator; import org.mustangproject.validator.ZUGFeRDValidator;
@@ -46,7 +47,7 @@ public class Main {
} }
private static String getUsage() { private static String getUsage() {
return "Usage: --action metrics|combine|extract|a3only|validate|visualize [-d,--directory] [-l,--listfromstdin] [-i,--ignore fileextension, PDF/A errors] | [-h,--help] \r\n" return "Usage: --action metrics|combine|extract|a3only|ubl|validate|visualize [-d,--directory] [-l,--listfromstdin] [-i,--ignore fileextension, PDF/A errors] | [-h,--help] \r\n"
+ " --action=metrics\n" + " --action=metrics\n"
+ " -d, --directory count ZUGFeRD files in directory to be scanned\n" + " -d, --directory count ZUGFeRD files in directory to be scanned\n"
+ " If it is a directory, it will recurse.\n" + " If it is a directory, it will recurse.\n"
@@ -85,11 +86,16 @@ public class Main {
+ " [--no-notices]: refrain from reporting notices\n" + " [--no-notices]: refrain from reporting notices\n"
+ " Additional parameters (optional - user will be prompted if not defined)\n" + " Additional parameters (optional - user will be prompted if not defined)\n"
+ " -d, --directory to check recursively \n" + " -d, --directory to check recursively \n"
+ " --action=ubl convert UN/CEFACT 2016b CII XML to UBL XML\n"
+ " [--source <filename>]: set input XML file\n"
+ " [--out <filename>]: set output XML file\n"
+ " --action=validateExpectInvalid validate directory expecting negative results \n" + " --action=validateExpectInvalid validate directory expecting negative results \n"
+ " [--no-notices]: refrain from reporting notices\n" + " [--no-notices]: refrain from reporting notices\n"
+ " Additional parameters (optional - user will be prompted if not defined)\n" + " Additional parameters (optional - user will be prompted if not defined)\n"
+ " -d, --directory to check recursively\n" + " -d, --directory to check recursively\n"
+ " --action=visualize convert XML to HTML \n" + " --action=visualize convert XML to HTML \n"
+ " [--source <filename>]: set input XML file\n"
+ " [--out <filename>]: set output HTML file\n"
; ;
} }
@@ -250,6 +256,38 @@ public class Main {
Files.write(Paths.get(outName), xml.getBytes()); Files.write(Paths.get(outName), xml.getBytes());
System.out.println("Written to " + outName); System.out.println("Written to " + outName);
}
/***
* converts from CII to UBL
* @param xmlName
* @param outName
* @throws IOException
* @throws TransformerException
*/
private static void performUBL(String xmlName, String outName) throws IOException, TransformerException {
// Get params from user if not already defined
if (xmlName == null) {
xmlName = getFilenameFromUser("Factur-X XML source", "factur-x.xml", "xml", true, false);
} else {
System.out.println("Factur-X XML source set to " + xmlName);
}
if (outName == null) {
outName = getFilenameFromUser("UBL target", "ubl-invoice.xml", "xml", false, true);
} else {
System.out.println("UBL target to " + outName);
}
// Verify params
ensureFileExists(xmlName);
ensureFileNotExists(outName);
// All params are good! continue...
CIIToUBL c2u = new CIIToUBL();
c2u.convert(new File(xmlName), new File(outName));
System.out.println("Written to " + outName);
} }
/*** /***
* the main function of the commandline tool... * the main function of the commandline tool...
@@ -338,6 +376,9 @@ public class Main {
} else if ((action!=null)&&(action.equals("upgrade"))) { } else if ((action!=null)&&(action.equals("upgrade"))) {
performUpgrade(sourceName, outName); performUpgrade(sourceName, outName);
optionsRecognized=true; optionsRecognized=true;
} else if ((action!=null)&&(action.equals("ubl"))) {
performUBL(sourceName, outName);
optionsRecognized=true;
} else if ((action!=null)&&(action.equals("validate"))) { } else if ((action!=null)&&(action.equals("validate"))) {
optionsRecognized=performValidate(sourceName, noNotices!=null&&noNotices, parser.getOptionValue(logAppendOption)); optionsRecognized=performValidate(sourceName, noNotices!=null&&noNotices, parser.getOptionValue(logAppendOption));
} else if ((action!=null)&&(action.equals("validateExpectValid"))) { } else if ((action!=null)&&(action.equals("validateExpectValid"))) {

View File

@@ -3,13 +3,13 @@
<parent> <parent>
<groupId>org.mustangproject</groupId> <groupId>org.mustangproject</groupId>
<artifactId>core</artifactId> <artifactId>core</artifactId>
<version>2.0.4-SNAPSHOT</version> <version>2.1.1-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.0.4-SNAPSHOT</version> <version>2.1.1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>Library to write, read and validate e-invoices (Factur-X, ZUGFeRD and to a limited extend XRechnung/CII). </name> <name>Library to write, read and validate e-invoices (Factur-X, ZUGFeRD and to a limited extend XRechnung/CII). </name>
<description>The Mustang project is a java library to read, write and validate Factur-X/ZUGFeRD meta data inside your invoice PDFs. To write files, a provided PDF/A will be combined with generated or provided XML. <description>The Mustang project is a java library to read, write and validate Factur-X/ZUGFeRD meta data inside your invoice PDFs. To write files, a provided PDF/A will be combined with generated or provided XML.
@@ -88,7 +88,13 @@
<dependency> <dependency>
<groupId>com.helger</groupId> <groupId>com.helger</groupId>
<artifactId>en16931-cii2ubl</artifactId> <artifactId>en16931-cii2ubl</artifactId>
<version>1.2.5</version> <version>1.3.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.3</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -115,6 +121,12 @@
<version>9.1.1</version> <version>9.1.1</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- API -->
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.3</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
@@ -124,12 +136,6 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version> <version>3.6.1</version>
<configuration> <configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.mustangproject.toecount.Toecount</mainClass>
</manifest>
</archive>
<descriptorRefs> <descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef> <descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs> </descriptorRefs>
@@ -145,12 +151,7 @@
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>3.2.1</version> <version>3.2.1</version>
<configuration> <configuration>
<shadedArtifactAttached>true</shadedArtifactAttached> <shadedArtifactAttached>false</shadedArtifactAttached>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.mustangproject.toecount.Toecount</mainClass>
</transformer>
</transformers>
<minimizeJar>false</minimizeJar><!-- no longer java 11 compatible if set to true because it removes e.g. javax/xml/bind/annotation/XmlSchema--> <minimizeJar>false</minimizeJar><!-- no longer java 11 compatible if set to true because it removes e.g. javax/xml/bind/annotation/XmlSchema-->
<filters> <filters>

View File

@@ -268,10 +268,6 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
return vatID; return vatID;
} }
public String getZip() {
return zip;
}
@Override @Override
public IZUGFeRDExportableContact getContact() { public IZUGFeRDExportableContact getContact() {
return contact; return contact;

View File

@@ -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.0.4-SNAPSHOT</version> <version>2.1.1-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>Mustang</name> <name>Mustang</name>

View File

@@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.mustangproject</groupId> <groupId>org.mustangproject</groupId>
<artifactId>core</artifactId> <artifactId>core</artifactId>
<version>2.0.4-SNAPSHOT</version> <version>2.1.1-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.0.4-SNAPSHOT</version> <version>2.1.1-SNAPSHOT</version>
<repositories> <repositories>
<repository> <repository>
<!-- for jargs --> <!-- for jargs -->
@@ -75,7 +75,7 @@
<dependency> <dependency>
<groupId>org.mustangproject</groupId> <groupId>org.mustangproject</groupId>
<artifactId>library</artifactId> <artifactId>library</artifactId>
<version>2.0.4-SNAPSHOT</version> <version>2.1.1-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.xmlunit</groupId> <groupId>org.xmlunit</groupId>