This commit is contained in:
jstaerk
2025-09-01 10:38:54 +02:00
parent b8800b3506
commit dadf0de4b0
4 changed files with 22 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
- added JSONIgnore for Products intra community supply, reverse charge and invoice's isValid (which rather means isComplete, by the way) - added JSONIgnore for Products intra community supply, reverse charge and invoice's isValid (which rather means isComplete, by the way)
- #917 - #917
- #915
- #921
- #926
-
2.19.0 2.19.0
======= =======
2025-08-12 2025-08-12

View File

@@ -14,6 +14,7 @@ public class ValidationContext {
private String profile = null; private String profile = null;
private String signature = null; private String signature = null;
private boolean isValid = true; private boolean isValid = true;
private boolean hasPDF = false;
protected Logger logger; protected Logger logger;
private String filename; private String filename;
@@ -22,6 +23,14 @@ public class ValidationContext {
results = new Vector<>(); results = new Vector<>();
} }
public void setHasPDF() {
hasPDF=true;
}
public boolean hasPDF() {
return hasPDF;
}
public void addResultItem(ValidationResultItem vr) throws IrrecoverableValidationError { public void addResultItem(ValidationResultItem vr) throws IrrecoverableValidationError {
results.add(vr); results.add(vr);

View File

@@ -374,6 +374,14 @@ public class XMLValidator extends Validator {
addUnsupportedProfileResultItem(); 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) { if (xsltFilename != null) {

View File

@@ -121,6 +121,7 @@ public class ZUGFeRDValidator {
// Avoid reading again from file // Avoid reading again from file
pdfv.setFilenameAndContents(contextFilename, content); pdfv.setFilenameAndContents(contextFilename, content);
context.setHasPDF();
optionsRecognized = true; optionsRecognized = true;
finalStringResult.append("<pdf>"); finalStringResult.append("<pdf>");
try { try {