xrechnungimporter to accept filename and inputstring, zugferdimporter to accept xml files
This commit is contained in:
@@ -173,6 +173,29 @@ public class ZF2ZInvoiceImporterTest extends ResourceCase {
|
||||
assertEquals("recipient@test.org", invoice.getRecipient().getEmail());
|
||||
assertEquals("28934", invoice.getBuyerOrderReferencedDocumentID());
|
||||
|
||||
}
|
||||
public void testEdgeInvoiceImportUBL() {
|
||||
|
||||
File UBLinputFile = getResourceAsFile("01.01a-INVOICE_ubl.xml");
|
||||
boolean hasExceptions = false;
|
||||
|
||||
ZUGFeRDInvoiceImporter zii = null;
|
||||
Invoice invoice = null;
|
||||
try {
|
||||
zii = new ZUGFeRDInvoiceImporter(new FileInputStream(UBLinputFile));
|
||||
invoice = zii.extractInvoice();
|
||||
} catch (XPathExpressionException | ParseException | FileNotFoundException e) {
|
||||
hasExceptions = true;
|
||||
}
|
||||
assertFalse(hasExceptions);
|
||||
// Reading ZUGFeRD
|
||||
assertEquals(new BigDecimal("288.79"), invoice.getZFItems()[0].getPrice());
|
||||
assertEquals("04011000-12345-03", invoice.getReferenceNumber());
|
||||
assertEquals("seller@email.de", invoice.getSender().getContact().getEMail());
|
||||
assertEquals("12345", invoice.getRecipient().getZIP());
|
||||
invoice.getPaymentTerms().get
|
||||
assertEquals("DE75512108001245126199", invoice.getDeliveryAddress().getBankDetails().getIBAN());
|
||||
|
||||
}
|
||||
|
||||
public void testZF1Import() {
|
||||
|
||||
Reference in New Issue
Block a user