Merge pull request #214 from ZUGFeRD/issues/213
Enabling functionality via Command line, changing POM so no errors occur
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
2.1.0
|
||||
=======
|
||||
|
||||
- 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
|
||||
- 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
|
||||
=======
|
||||
|
||||
@@ -20,6 +20,7 @@ package org.mustangproject.commandline;
|
||||
|
||||
import com.sanityinc.jargs.CmdLineParser;
|
||||
import com.sanityinc.jargs.CmdLineParser.Option;
|
||||
import org.mustangproject.CII.CIIToUBL;
|
||||
import org.mustangproject.ZUGFeRD.*;
|
||||
import org.mustangproject.validator.Validator;
|
||||
import org.mustangproject.validator.ZUGFeRDValidator;
|
||||
@@ -46,7 +47,7 @@ public class Main {
|
||||
}
|
||||
|
||||
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"
|
||||
+ " -d, --directory count ZUGFeRD files in directory to be scanned\n"
|
||||
+ " If it is a directory, it will recurse.\n"
|
||||
@@ -85,11 +86,16 @@ public class Main {
|
||||
+ " [--no-notices]: refrain from reporting notices\n"
|
||||
+ " Additional parameters (optional - user will be prompted if not defined)\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"
|
||||
+ " [--no-notices]: refrain from reporting notices\n"
|
||||
+ " Additional parameters (optional - user will be prompted if not defined)\n"
|
||||
+ " -d, --directory to check recursively\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());
|
||||
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...
|
||||
@@ -338,6 +376,9 @@ public class Main {
|
||||
} else if ((action!=null)&&(action.equals("upgrade"))) {
|
||||
performUpgrade(sourceName, outName);
|
||||
optionsRecognized=true;
|
||||
} else if ((action!=null)&&(action.equals("ubl"))) {
|
||||
performUBL(sourceName, outName);
|
||||
optionsRecognized=true;
|
||||
} else if ((action!=null)&&(action.equals("validate"))) {
|
||||
optionsRecognized=performValidate(sourceName, noNotices!=null&&noNotices, parser.getOptionValue(logAppendOption));
|
||||
} else if ((action!=null)&&(action.equals("validateExpectValid"))) {
|
||||
|
||||
@@ -88,7 +88,13 @@
|
||||
<dependency>
|
||||
<groupId>com.helger</groupId>
|
||||
<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>
|
||||
@@ -115,6 +121,12 @@
|
||||
<version>9.1.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- API -->
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
<version>2.3.3</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
@@ -124,12 +136,6 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>org.mustangproject.toecount.Toecount</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
@@ -145,12 +151,7 @@
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<configuration>
|
||||
<shadedArtifactAttached>true</shadedArtifactAttached>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>org.mustangproject.toecount.Toecount</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||
<minimizeJar>false</minimizeJar><!-- no longer java 11 compatible if set to true because it removes e.g. javax/xml/bind/annotation/XmlSchema-->
|
||||
<filters>
|
||||
|
||||
|
||||
@@ -268,10 +268,6 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
return vatID;
|
||||
}
|
||||
|
||||
public String getZip() {
|
||||
return zip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IZUGFeRDExportableContact getContact() {
|
||||
return contact;
|
||||
|
||||
Reference in New Issue
Block a user