This commit is contained in:
jstaerk
2025-01-14 07:05:46 +01:00
parent c1152e20fe
commit 8c7a2c322d
3 changed files with 31 additions and 7 deletions

View File

@@ -375,7 +375,7 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
}
public void testImportMinimum() {
public void testImportMinimum() {
File CIIinputFile = getResourceAsFile("cii/facturFrMinimum.xml");
try {
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(new FileInputStream(CIIinputFile));
@@ -394,6 +394,28 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
}
}
public void testImportUBLCreditnote() { // Confirm some basics also work with UBL credit notes
File CIIinputFile = getResourceAsFile("ubl/UBL-CreditNote-2.1-Example.ubl.xml");
try {
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(new FileInputStream(CIIinputFile));
CalculatedInvoice i = new CalculatedInvoice();
zii.extractInto(i);
assertEquals("TOSL108", i.getNumber());
assertEquals("729", i.getGrandTotal().toString());
} catch (IOException e) {
fail("IOException not expected");
} catch (XPathExpressionException e) {
throw new RuntimeException(e);
} catch (ParseException e) {
throw new RuntimeException(e);
}
}