WECLAPP-31713 Add PARTIAL_BILLING

Fix line ending problem in UTLTest
Fix typo
This commit is contained in:
Sebastian Sieber
2021-03-02 12:43:55 +01:00
parent 4e6af53119
commit b69aef624d
3 changed files with 13 additions and 12 deletions

View File

@@ -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 * @return the ID of the document
*/ */

View File

@@ -23,4 +23,5 @@ public class DocumentCodeTypeConstants {
public static final String CREDITNOTE = "381"; public static final String CREDITNOTE = "381";
public static final String DEBITNOTE = "84"; public static final String DEBITNOTE = "84";
public static final String CORRECTEDINVOICE = "384"; public static final String CORRECTEDINVOICE = "384";
public static final String PARTIAL_BILLING = "326";
} }

View File

@@ -21,32 +21,32 @@
*/ */
package org.mustangproject.ZUGFeRD; 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.File;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import org.junit.FixMethodOrder;
import org.junit.runners.MethodSorters;
import org.mustangproject.CII.CIIToUBL;
@FixMethodOrder(MethodSorters.NAME_ASCENDING) @FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class UBLTest extends ResourceCase { public class UBLTest extends ResourceCase {
public void testUBLBasic() { public void testUBLBasic() {
// the writing part // the writing part
CIIToUBL c2u = new CIIToUBL(); final CIIToUBL c2u = new CIIToUBL();
String sourceFilename = "factur-x.xml"; final String sourceFilename = "factur-x.xml";
File input = getResourceAsFile(sourceFilename); final File input = getResourceAsFile(sourceFilename);
File expectedFile = getResourceAsFile("ubl-conv-ubl-output-factur-x.xml"); final File expectedFile = getResourceAsFile("ubl-conv-ubl-output-factur-x.xml");
String expected = null; String expected = null;
String result = null; String result = null;
try { try {
File tempFile = File.createTempFile("ZUGFeRD-UBL-", "-test"); final File tempFile = File.createTempFile("ZUGFeRD-UBL-", "-test");
c2u.convert(input, tempFile); c2u.convert(input, tempFile);
expected = ResourceUtilities.readFile(StandardCharsets.UTF_8, expectedFile.getAbsolutePath()); expected = ResourceUtilities.readFile(StandardCharsets.UTF_8, expectedFile.getAbsolutePath());
result = ResourceUtilities.readFile(StandardCharsets.UTF_8, tempFile.getAbsolutePath()); result = ResourceUtilities.readFile(StandardCharsets.UTF_8, tempFile.getAbsolutePath()).replaceAll("\r\n", "\n");
} catch (IOException e) { } catch (final IOException e) {
fail("Exception should not happen: "+e.getMessage()); fail("Exception should not happen: "+e.getMessage());
} }