closes #926
This commit is contained in:
@@ -14,6 +14,7 @@ public class ValidationContext {
|
||||
private String profile = null;
|
||||
private String signature = null;
|
||||
private boolean isValid = true;
|
||||
private boolean hasPDF = false;
|
||||
protected Logger logger;
|
||||
private String filename;
|
||||
|
||||
@@ -22,6 +23,14 @@ public class ValidationContext {
|
||||
results = new Vector<>();
|
||||
}
|
||||
|
||||
public void setHasPDF() {
|
||||
hasPDF=true;
|
||||
}
|
||||
|
||||
public boolean hasPDF() {
|
||||
return hasPDF;
|
||||
}
|
||||
|
||||
public void addResultItem(ValidationResultItem vr) throws IrrecoverableValidationError {
|
||||
results.add(vr);
|
||||
|
||||
|
||||
@@ -374,6 +374,14 @@ public class XMLValidator extends Validator {
|
||||
addUnsupportedProfileResultItem();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// no CII -> has to be UBL
|
||||
if (context.hasPDF()) {
|
||||
final ValidationResultItem vri = new ValidationResultItem(ESeverity.error, "Factur-X/ZUGFeRD and Order-X are always strictly CII only, no UBL allowed.").setSection(17)
|
||||
.setPart(EPart.fx);
|
||||
context.addResultItem(vri);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (xsltFilename != null) {
|
||||
|
||||
@@ -121,6 +121,7 @@ public class ZUGFeRDValidator {
|
||||
// Avoid reading again from file
|
||||
pdfv.setFilenameAndContents(contextFilename, content);
|
||||
|
||||
context.setHasPDF();
|
||||
optionsRecognized = true;
|
||||
finalStringResult.append("<pdf>");
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user