|
|
|
|
@@ -96,8 +96,8 @@ public class ZF2PushTest extends TestCase {
|
|
|
|
|
fail("Exception should not be raised");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter(TARGET_PDF);
|
|
|
|
|
Invoice i=new Invoice();
|
|
|
|
|
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(TARGET_PDF);
|
|
|
|
|
Invoice i = new Invoice();
|
|
|
|
|
try {
|
|
|
|
|
zii.extractInto(i);
|
|
|
|
|
} catch (XPathExpressionException e) {
|
|
|
|
|
@@ -164,7 +164,7 @@ ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter(TARGET_PDF);
|
|
|
|
|
fail("IOException should not be raised");
|
|
|
|
|
}
|
|
|
|
|
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(TARGET_ATTACHMENTSPDF);
|
|
|
|
|
Invoice i= null;
|
|
|
|
|
Invoice i = null;
|
|
|
|
|
try {
|
|
|
|
|
i = zii.extractInvoice();
|
|
|
|
|
} catch (XPathExpressionException e) {
|
|
|
|
|
@@ -172,7 +172,7 @@ ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter(TARGET_PDF);
|
|
|
|
|
} catch (ParseException e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
assertEquals(senderDescription,i.getSender().getDescription());
|
|
|
|
|
assertEquals(senderDescription, i.getSender().getDescription());
|
|
|
|
|
|
|
|
|
|
// now check the contents (like MustangReaderTest)
|
|
|
|
|
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_ATTACHMENTSPDF);
|
|
|
|
|
@@ -302,7 +302,7 @@ ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter(TARGET_PDF);
|
|
|
|
|
// .addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)).addAllowance(new Allowance().setPercent(new BigDecimal(50)))));
|
|
|
|
|
|
|
|
|
|
ze.setTransaction(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date())
|
|
|
|
|
.setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addVATID("DE0815").addTaxID ("4711"))
|
|
|
|
|
.setSender(new TradeParty(orgname, "teststr", "55232", "teststadt", "DE").addVATID("DE0815").addTaxID("4711"))
|
|
|
|
|
.setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addVATID("DE0816")
|
|
|
|
|
.setContact(new Contact("contact testname", "123456", "contact.testemail@example.org").setFax("0911623562")))
|
|
|
|
|
.setDeliveryAddress(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addVATID("DE0816"))
|
|
|
|
|
@@ -372,7 +372,7 @@ ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter(TARGET_PDF);
|
|
|
|
|
fail("IOException should not be raised");
|
|
|
|
|
}
|
|
|
|
|
ZUGFeRDInvoiceImporter zii = new ZUGFeRDInvoiceImporter(TARGET_INTRACOMMUNITYSUPPLYMANUALPDF);
|
|
|
|
|
Invoice i= null;
|
|
|
|
|
Invoice i = null;
|
|
|
|
|
try {
|
|
|
|
|
i = zii.extractInvoice();
|
|
|
|
|
} catch (XPathExpressionException e) {
|
|
|
|
|
@@ -530,7 +530,7 @@ ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter(TARGET_PDF);
|
|
|
|
|
.setContractReferencedDocument(contractID)
|
|
|
|
|
.setRecipient(new TradeParty("Franz Müller", "teststr.12", "55232", "Entenhausen", "DE").addGlobalID(gln).setEmail("recipient@test.org").addVATID("DE4711")
|
|
|
|
|
.setContact(new Contact("Franz Müller", "01779999999", "franz@mueller.de", "teststr. 12", "55232", "Entenhausen", "DE").setFax("++49555123456")).setAdditionalAddress("Hinterhaus 3"))
|
|
|
|
|
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(16)).addGlobalID(gtin).setSellerAssignedID("4711"), price, new BigDecimal(1.0)).addReferencedLineID("xxx").addNote("item level 1/1").addAllowance(new Allowance(new BigDecimal(0.02)).setReason("item discount").setTaxPercent(new BigDecimal(16))).setDetailedDeliveryPeriod(sdf.parse("2020-01-13"), sdf.parse("2020-01-15")))
|
|
|
|
|
.addItem(new Item(new Product("Testprodukt", "", "H87", new BigDecimal(16)).addGlobalID(gtin).setSellerAssignedID("4711"), price, new BigDecimal(1.0)).setId("a123").addReferencedLineID("xxx").addNote("item level 1/1").addAllowance(new Allowance(new BigDecimal(0.02)).setReason("item discount").setTaxPercent(new BigDecimal(16))).setDetailedDeliveryPeriod(sdf.parse("2020-01-13"), sdf.parse("2020-01-15")))
|
|
|
|
|
.addCharge(new Charge(new BigDecimal(0.5)).setReason("quick delivery charge").setTaxPercent(new BigDecimal(16)))
|
|
|
|
|
.addAllowance(new Allowance(new BigDecimal(0.2)).setReason("discount").setTaxPercent(new BigDecimal(16)))
|
|
|
|
|
.addCashDiscount(new CashDiscount(new BigDecimal(2), 14))
|
|
|
|
|
@@ -562,7 +562,7 @@ ZUGFeRDInvoiceImporter zii=new ZUGFeRDInvoiceImporter(TARGET_PDF);
|
|
|
|
|
assertTrue(zi.getUTF8().contains(occurrenceFrom));
|
|
|
|
|
assertTrue(zi.getUTF8().contains(occurrenceTo));
|
|
|
|
|
assertTrue(zi.getUTF8().contains(contractID));
|
|
|
|
|
|
|
|
|
|
assertEquals(zi.importedInvoice.getZFItems()[0].getId(), "a123");
|
|
|
|
|
assertTrue(zi.getUTF8().contains("20200113")); // to contain item delivery periods
|
|
|
|
|
assertTrue(zi.getUTF8().contains("20200115")); // to contain item delivery periods
|
|
|
|
|
|
|
|
|
|
|