allow to create fx 1 files with command line again
This commit is contained in:
@@ -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