From c8beb71b1577b1c647741ee0f6eb4e179be0755f Mon Sep 17 00:00:00 2001 From: jstaerk Date: Fri, 20 Sep 2024 11:53:30 +0200 Subject: [PATCH] added eeisi test --- .../ZUGFeRD/ZF2ZInvoiceImporterTest.java | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java index b281a67c..cde54bc0 100644 --- a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java +++ b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2ZInvoiceImporterTest.java @@ -313,4 +313,36 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase { } + + public void testEEISI_300_cii_Import() { + boolean hasExceptions = false; + File input = getResourceAsFile("not_validating_full_invoice_based_onTest_EeISI_300_CENfullmodel2.ubl.xml"); + + + ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(); + try { + zii.fromXML(new String(Files.readAllBytes(input.toPath()), StandardCharsets.UTF_8)); + + } catch (IOException e) { + hasExceptions = true; + } + + Invoice invoice = null; + try { + invoice = zii.extractInvoice(); + assertEquals("Seller contact point",invoice.getSender().getName()); + /* + Seller contact point + +41 345 654455 + seller@contact.de);*/ + } catch (XPathExpressionException | ParseException e) { + hasExceptions = true; + } + assertFalse(hasExceptions); + TransactionCalculator tc = new TransactionCalculator(invoice); + assertEquals(new BigDecimal("205.00"), tc.getGrandTotal()); + + } + + }