attempt for new tests(which compile but do not yet even fail)

This commit is contained in:
jstaerk
2020-09-03 21:24:57 +02:00
parent d8824a15e5
commit 03916461ba
3 changed files with 14 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ public class Invoice implements IExportableTransaction {
protected BigDecimal totalPrepaidAmount = null; protected BigDecimal totalPrepaidAmount = null;
protected IZUGFeRDExportableContact ownContact = null, recipient = null, deliveryAddress = null; protected IZUGFeRDExportableContact ownContact = null, recipient = null, deliveryAddress = null;
protected ArrayList<IZUGFeRDExportableItem> ZFItems = null; protected ArrayList<IZUGFeRDExportableItem> ZFItems = null;
protected String contractReferencedDocument = null;
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<IZUGFeRDAllowanceCharge>(), protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<IZUGFeRDAllowanceCharge>(),
Charges = new ArrayList<IZUGFeRDAllowanceCharge>(), LogisticsServiceCharges = new ArrayList<IZUGFeRDAllowanceCharge>(); Charges = new ArrayList<IZUGFeRDAllowanceCharge>(), LogisticsServiceCharges = new ArrayList<IZUGFeRDAllowanceCharge>();
@@ -50,6 +51,8 @@ public class Invoice implements IExportableTransaction {
return documentName; return documentName;
} }
public String getContractReferencedDocument() { return contractReferencedDocument; }
public Invoice setDocumentName(String documentName) { public Invoice setDocumentName(String documentName) {
this.documentName = documentName; this.documentName = documentName;
return this; return this;
@@ -419,4 +422,9 @@ public class Invoice implements IExportableTransaction {
Allowances.add(izac); Allowances.add(izac);
return this; return this;
} }
public Invoice setContractReferencedDocument(String s) {
contractReferencedDocument=s;
return this;
}
} }

View File

@@ -95,6 +95,10 @@ public interface IExportableTransaction {
return null; return null;
} }
default String getContractReferencedDocument() {
return null;
}
/** /**
* who processed the order * who processed the order

View File

@@ -51,7 +51,7 @@ public class ZF2PushTest extends TestCase {
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors() .setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
.load(SOURCE_PDF)) { .load(SOURCE_PDF)) {
ze.setTransaction(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setOwnOrganisationName(orgname).setOwnStreet("teststr").setOwnZIP("55232").setOwnLocation("teststadt").setOwnCountry("DE").setOwnTaxID("4711").setOwnVATID("DE19990815").setRecipient(new Contact("Franz Müller", "0177123456", "fmueller@test.com", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number).addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)), amount, new BigDecimal(1.0)))); ze.setTransaction(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setContractReferencedDocument("0815").setOwnOrganisationName(orgname).setOwnStreet("teststr").setOwnZIP("55232").setOwnLocation("teststadt").setOwnCountry("DE").setOwnTaxID("4711").setOwnVATID("DE19990815").setRecipient(new Contact("Franz Müller", "0177123456", "fmueller@test.com", "teststr.12", "55232", "Entenhausen", "DE")).setNumber(number).addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(0)), amount, new BigDecimal(1.0))));
String theXML = new String(ze.getProvider().getXML()); String theXML = new String(ze.getProvider().getXML());
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice")); assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
ze.export(TARGET_PDF); ze.export(TARGET_PDF);
@@ -63,6 +63,7 @@ public class ZF2PushTest extends TestCase {
ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF); ZUGFeRDImporter zi = new ZUGFeRDImporter(TARGET_PDF);
assertTrue(zi.getUTF8().contains("EUR")); assertTrue(zi.getUTF8().contains("EUR"));
assertTrue(zi.getUTF8().contains("0815"));
// Reading ZUGFeRD // Reading ZUGFeRD
assertEquals(amountStr, zi.getAmount()); assertEquals(amountStr, zi.getAmount());