diff --git a/mustang/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDExporter.java b/mustang/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDExporter.java index 9729ce89..b774c18d 100644 --- a/mustang/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDExporter.java +++ b/mustang/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDExporter.java @@ -81,6 +81,7 @@ public class ZUGFeRDExporter { * pass a IZUGFeRDExportableTransaction for the XML to be populated. */ byte[] zugferdData = null; + private boolean isTest; private String nDigitFormat(BigDecimal value, int scale) { @@ -154,6 +155,12 @@ public class ZUGFeRDExporter { conformanceLevel=newLevel; } + /** + * enables the flag to indicate a test invoice in the XML structure + * */ + public void setTest() { + isTest=true; + } /** * Makes A PDF/A3a-compliant document from a PDF-A1 compliant document (on @@ -225,6 +232,11 @@ public class ZUGFeRDExporter { private String getZugferdXMLForTransaction(IZUGFeRDExportableTransaction trans) { SimpleDateFormat zugferdDateFormat = new SimpleDateFormat("yyyyMMdd"); //$NON-NLS-1$ + String testBooleanStr="false"; + if (isTest) { + testBooleanStr="true"; + + } String xml= "\n" //$NON-NLS-1$ + "\n" //$NON-NLS-1$ + " \n" //$NON-NLS-1$ - + " false\n" //$NON-NLS-1$ + + " "+testBooleanStr+"\n" //$NON-NLS-1$ + " \n" //$NON-NLS-1$ + " urn:ferd:CrossIndustryDocument:invoice:1p0:comfort\n" //$NON-NLS-1$ + " \n" //$NON-NLS-1$