allow to create fx 1 files with command line again
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
- allow to create fx 1 files with command line again
|
||||
- is maven build profile to gen xslt, mvn clean package -P generateXSLTFromSchematron
|
||||
- OXPullprovider to no longer generate invsalid XML if a duedate is set
|
||||
|
||||
|
||||
@@ -635,6 +635,9 @@ public class Main {
|
||||
}
|
||||
|
||||
EStandard standard=EStandard.facturx;
|
||||
if (format.equals("zf")) {
|
||||
standard=EStandard.zugferd;
|
||||
}
|
||||
if (format.equals("da")) {
|
||||
standard=EStandard.despatchadvice;
|
||||
|
||||
@@ -644,8 +647,6 @@ public class Main {
|
||||
if (format.equals("ox")) {
|
||||
standard=EStandard.orderx;
|
||||
}
|
||||
|
||||
|
||||
if (zfProfile.equals("b")) {
|
||||
zfConformanceLevelProfile = Profiles.getByName(standard, "BASIC", zfIntVersion);
|
||||
} else if (zfProfile.equals("c")) {
|
||||
@@ -657,19 +658,19 @@ public class Main {
|
||||
}
|
||||
} else if (((format.equals("zf")) && (zfIntVersion == 2)) || (format.equals("fx"))) {
|
||||
if (zfProfile.equals("m")) {
|
||||
zfConformanceLevelProfile = Profiles.getByName("MINIMUM", zfIntVersion);
|
||||
zfConformanceLevelProfile = Profiles.getByName(standard, "MINIMUM", zfIntVersion);
|
||||
} else if (zfProfile.equals("w")) {
|
||||
zfConformanceLevelProfile = Profiles.getByName("BASICWL", zfIntVersion);
|
||||
zfConformanceLevelProfile = Profiles.getByName(standard, "BASICWL", zfIntVersion);
|
||||
} else if (zfProfile.equals("b")) {
|
||||
zfConformanceLevelProfile = Profiles.getByName("BASIC", zfIntVersion);
|
||||
zfConformanceLevelProfile = Profiles.getByName(standard, "BASIC", zfIntVersion);
|
||||
} else if (zfProfile.equals("c")) {
|
||||
zfConformanceLevelProfile = Profiles.getByName("CIUS", zfIntVersion);
|
||||
zfConformanceLevelProfile = Profiles.getByName(standard, "CIUS", zfIntVersion);
|
||||
} else if (zfProfile.equals("e")) {
|
||||
zfConformanceLevelProfile = Profiles.getByName("EN16931", zfIntVersion);
|
||||
zfConformanceLevelProfile = Profiles.getByName(standard, "EN16931", zfIntVersion);
|
||||
} else if (zfProfile.equals("t")) {
|
||||
zfConformanceLevelProfile = Profiles.getByName("EXTENDED", zfIntVersion);
|
||||
zfConformanceLevelProfile = Profiles.getByName(standard, "EXTENDED", zfIntVersion);
|
||||
} else if (zfProfile.equals("x")) {
|
||||
zfConformanceLevelProfile = Profiles.getByName("XRECHNUNG", zfIntVersion);
|
||||
zfConformanceLevelProfile = Profiles.getByName(standard, "XRECHNUNG", zfIntVersion);
|
||||
} else {
|
||||
throw new Exception(String.format("Unknown ZUGFeRD profile '%s'", zfProfile));
|
||||
}
|
||||
@@ -698,7 +699,7 @@ public class Main {
|
||||
|
||||
} else {
|
||||
ze = new ZUGFeRDExporterFromA1().setProducer("Mustang-cli")
|
||||
.setZUGFeRDVersion(zfIntVersion)
|
||||
.setZUGFeRDVersion(standard, zfIntVersion)
|
||||
.setCreator(System.getProperty("user.name")).setProfile(zfConformanceLevelProfile);
|
||||
if (ignoreInputErrors) {
|
||||
((ZUGFeRDExporterFromA1)ze).ignorePDFAErrors();
|
||||
|
||||
@@ -71,7 +71,11 @@ public class Profiles {
|
||||
}
|
||||
return result;
|
||||
} else {
|
||||
return getByName(name, version);
|
||||
int generation = version;
|
||||
if ((standard==EStandard.facturx) && (version==1)) {
|
||||
generation = 2;
|
||||
}
|
||||
return getByName(name, generation);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ package org.mustangproject.ZUGFeRD;
|
||||
import org.apache.pdfbox.preflight.PreflightDocument;
|
||||
import org.apache.pdfbox.preflight.exception.ValidationException;
|
||||
import org.apache.pdfbox.preflight.parser.PreflightParser;
|
||||
import org.mustangproject.EStandard;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
import java.io.IOException;
|
||||
@@ -106,6 +107,9 @@ public class ZUGFeRDExporterFromA1 extends ZUGFeRDExporterFromA3 implements IZUG
|
||||
public ZUGFeRDExporterFromA1 setProducer(String producer){
|
||||
return (ZUGFeRDExporterFromA1) super.setProducer(producer);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 setZUGFeRDVersion(EStandard est, int version){
|
||||
return (ZUGFeRDExporterFromA1) super.setZUGFeRDVersion(est, version);
|
||||
}
|
||||
public ZUGFeRDExporterFromA1 setZUGFeRDVersion(int version){
|
||||
return (ZUGFeRDExporterFromA1) super.setZUGFeRDVersion(version);
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.apache.xmpbox.type.BadFieldValueException;
|
||||
import org.apache.xmpbox.xml.DomXmpParser;
|
||||
import org.apache.xmpbox.xml.XmpParsingException;
|
||||
import org.apache.xmpbox.xml.XmpSerializer;
|
||||
import org.mustangproject.EStandard;
|
||||
import org.mustangproject.FileAttachment;
|
||||
|
||||
import javax.activation.DataSource;
|
||||
@@ -851,6 +852,28 @@ public class ZUGFeRDExporterFromA3 extends XRExporter implements IZUGFeRDExporte
|
||||
}
|
||||
}
|
||||
|
||||
public ZUGFeRDExporterFromA3 setZUGFeRDVersion(EStandard est, int version) {
|
||||
this.ZFVersion = version;
|
||||
if ((version<1) || (version>2)) {
|
||||
throw new IllegalArgumentException("Version not supported");
|
||||
}
|
||||
int generation=version;
|
||||
if ((est==EStandard.facturx)&&(version==1)) {
|
||||
generation=2;
|
||||
}
|
||||
if (generation == 1) {
|
||||
ZUGFeRD1PullProvider z1p = new ZUGFeRD1PullProvider();
|
||||
disableFacturX();
|
||||
setXMLProvider(z1p);
|
||||
} else if (generation == 2) {
|
||||
ZUGFeRD2PullProvider z2p = new ZUGFeRD2PullProvider();
|
||||
setXMLProvider(z2p);
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZUGFeRDExporterFromA3 setZUGFeRDVersion(int version) {
|
||||
this.ZFVersion = version;
|
||||
|
||||
Reference in New Issue
Block a user