diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java b/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java index 8f1f12c3..15520f2c 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java @@ -416,7 +416,7 @@ public interface IExportableTransaction { } /** - * get the ID of the prceding invoice, which is e.g. to be corrected if this is a correction + * get the ID of the preceding invoice, which is e.g. to be corrected if this is a correction * * @return the ID of the document */ diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/model/DocumentCodeTypeConstants.java b/library/src/main/java/org/mustangproject/ZUGFeRD/model/DocumentCodeTypeConstants.java index bbc2a7ac..74fac56a 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/model/DocumentCodeTypeConstants.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/model/DocumentCodeTypeConstants.java @@ -23,4 +23,5 @@ public class DocumentCodeTypeConstants { public static final String CREDITNOTE = "381"; public static final String DEBITNOTE = "84"; public static final String CORRECTEDINVOICE = "384"; + public static final String PARTIAL_BILLING = "326"; } diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/UBLTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/UBLTest.java index 00b20dd1..cb02923c 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/UBLTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/UBLTest.java @@ -21,32 +21,32 @@ */ package org.mustangproject.ZUGFeRD; -import org.junit.FixMethodOrder; -import org.junit.runners.MethodSorters; -import org.mustangproject.CII.CIIToUBL; - import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; +import org.junit.FixMethodOrder; +import org.junit.runners.MethodSorters; +import org.mustangproject.CII.CIIToUBL; + @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class UBLTest extends ResourceCase { public void testUBLBasic() { // the writing part - CIIToUBL c2u = new CIIToUBL(); - String sourceFilename = "factur-x.xml"; - File input = getResourceAsFile(sourceFilename); - File expectedFile = getResourceAsFile("ubl-conv-ubl-output-factur-x.xml"); + final CIIToUBL c2u = new CIIToUBL(); + final String sourceFilename = "factur-x.xml"; + final File input = getResourceAsFile(sourceFilename); + final File expectedFile = getResourceAsFile("ubl-conv-ubl-output-factur-x.xml"); String expected = null; String result = null; try { - File tempFile = File.createTempFile("ZUGFeRD-UBL-", "-test"); + final File tempFile = File.createTempFile("ZUGFeRD-UBL-", "-test"); c2u.convert(input, tempFile); expected = ResourceUtilities.readFile(StandardCharsets.UTF_8, expectedFile.getAbsolutePath()); - result = ResourceUtilities.readFile(StandardCharsets.UTF_8, tempFile.getAbsolutePath()); - } catch (IOException e) { + result = ResourceUtilities.readFile(StandardCharsets.UTF_8, tempFile.getAbsolutePath()).replaceAll("\r\n", "\n"); + } catch (final IOException e) { fail("Exception should not happen: "+e.getMessage()); }