removed factories
This commit is contained in:
@@ -34,7 +34,7 @@ import junit.framework.TestCase;
|
||||
* @author jstaerk
|
||||
*
|
||||
*/
|
||||
public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExportableTransaction{
|
||||
public class BackwardCompatibilityTest extends TestCase implements IExportableTransaction {
|
||||
|
||||
final String TARGET_PDF_ZF1 = "./target/testout-MustangGnuaccountingBeispielRE-20171118_506zf1.pdf";
|
||||
final String TARGET_PDF_ZF2 = "./target/testout-MustangGnuaccountingBeispielRE-20171118_506zf2.pdf";
|
||||
@@ -55,9 +55,9 @@ public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExpor
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(1).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(1).setProfile(Profiles.EN16931).load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF_ZF1);
|
||||
|
||||
@@ -95,9 +95,9 @@ public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExpor
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile(Profiles.EN16931).load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF_ZF2);
|
||||
|
||||
@@ -133,10 +133,9 @@ public class BackwardCompatibilityTest extends TestCase implements IZUGFeRDExpor
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile(Profiles.EN16931).load(SOURCE_PDF)) {
|
||||
|
||||
ze.setFacturX();
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF_FX);
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTransaction {
|
||||
public class IExportableTransactionImpl implements IExportableTransaction {
|
||||
|
||||
private String number;
|
||||
private Date issueDate;
|
||||
@@ -150,107 +150,107 @@ public class IZUGFeRDExportableTransactionImpl implements IZUGFeRDExportableTran
|
||||
}
|
||||
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setNumber(String number) {
|
||||
public IExportableTransactionImpl setNumber(String number) {
|
||||
this.number = number;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setIssueDate(Date issueDate) {
|
||||
public IExportableTransactionImpl setIssueDate(Date issueDate) {
|
||||
this.issueDate = issueDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnOrganisationFullPlaintextInfo(String ownOrganisationFullPlaintextInfo) {
|
||||
public IExportableTransactionImpl setOwnOrganisationFullPlaintextInfo(String ownOrganisationFullPlaintextInfo) {
|
||||
this.ownOrganisationFullPlaintextInfo = ownOrganisationFullPlaintextInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setDueDate(Date dueDate) {
|
||||
public IExportableTransactionImpl setDueDate(Date dueDate) {
|
||||
this.dueDate = dueDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFAllowances(IZUGFeRDAllowanceCharge... zFAllowances) {
|
||||
public IExportableTransactionImpl setZFAllowances(IZUGFeRDAllowanceCharge... zFAllowances) {
|
||||
this.zFAllowances = zFAllowances;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFCharges(IZUGFeRDAllowanceCharge... zFCharges) {
|
||||
public IExportableTransactionImpl setZFCharges(IZUGFeRDAllowanceCharge... zFCharges) {
|
||||
this.zFCharges = zFCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFLogisticsServiceCharges(IZUGFeRDAllowanceCharge... zFLogisticsServiceCharges) {
|
||||
public IExportableTransactionImpl setZFLogisticsServiceCharges(IZUGFeRDAllowanceCharge... zFLogisticsServiceCharges) {
|
||||
this.zFLogisticsServiceCharges = zFLogisticsServiceCharges;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setZFItems(IZUGFeRDExportableItem... zFItems) {
|
||||
public IExportableTransactionImpl setZFItems(IZUGFeRDExportableItem... zFItems) {
|
||||
this.zFItems = zFItems;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setRecipient(IZUGFeRDExportableContact recipient) {
|
||||
public IExportableTransactionImpl setRecipient(IZUGFeRDExportableContact recipient) {
|
||||
this.recipient = recipient;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnTaxID(String ownTaxID) {
|
||||
public IExportableTransactionImpl setOwnTaxID(String ownTaxID) {
|
||||
this.ownTaxID = ownTaxID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnVATID(String ownVATID) {
|
||||
public IExportableTransactionImpl setOwnVATID(String ownVATID) {
|
||||
this.ownVATID = ownVATID;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnOrganisationName(String ownOrganisationName) {
|
||||
public IExportableTransactionImpl setOwnOrganisationName(String ownOrganisationName) {
|
||||
this.ownOrganisationName = ownOrganisationName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnStreet(String ownStreet) {
|
||||
public IExportableTransactionImpl setOwnStreet(String ownStreet) {
|
||||
this.ownStreet = ownStreet;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnZIP(String ownZIP) {
|
||||
public IExportableTransactionImpl setOwnZIP(String ownZIP) {
|
||||
this.ownZIP = ownZIP;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnLocation(String ownLocation) {
|
||||
public IExportableTransactionImpl setOwnLocation(String ownLocation) {
|
||||
this.ownLocation = ownLocation;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setOwnCountry(String ownCountry) {
|
||||
public IExportableTransactionImpl setOwnCountry(String ownCountry) {
|
||||
this.ownCountry = ownCountry;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setDeliveryDate(Date deliveryDate) {
|
||||
public IExportableTransactionImpl setDeliveryDate(Date deliveryDate) {
|
||||
this.deliveryDate = deliveryDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setCurrency(String currency) {
|
||||
public IExportableTransactionImpl setCurrency(String currency) {
|
||||
this.currency = currency;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setPaymentTermDescription(String paymentTermDescription) {
|
||||
public IExportableTransactionImpl setPaymentTermDescription(String paymentTermDescription) {
|
||||
this.paymentTermDescription = paymentTermDescription;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setReferenceNumber(String referenceNumber) {
|
||||
public IExportableTransactionImpl setReferenceNumber(String referenceNumber) {
|
||||
this.referenceNumber = referenceNumber;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableTransactionImpl setTradeSettlementPayment(IZUGFeRDTradeSettlementPayment... settlementPayments) {
|
||||
public IExportableTransactionImpl setTradeSettlementPayment(IZUGFeRDTradeSettlementPayment... settlementPayments) {
|
||||
this.settlementPayments = settlementPayments;
|
||||
return this;
|
||||
}
|
||||
@@ -22,9 +22,7 @@ import junit.framework.TestCase;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.MustangReaderTestCase.Item;
|
||||
|
||||
public abstract class MustangReaderTestCase extends TestCase implements IZUGFeRDExportableTransaction {
|
||||
public abstract class MustangReaderTestCase extends TestCase implements IExportableTransaction {
|
||||
|
||||
public MustangReaderTestCase(String testName) {
|
||||
super(testName);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
try {
|
||||
InputStream SOURCE_PDF = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1Factory().setProducer("My Application").setCreator("Test").setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931)
|
||||
IZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1().setProducer("My Application").setCreator("Test").setProfile(Profiles.EN16931)
|
||||
.load(SOURCE_PDF);
|
||||
|
||||
final byte[] UTF8ByteOrderMark = new byte[]{(byte) 0xef, (byte) 0xbb, (byte) 0xbf};
|
||||
@@ -256,7 +256,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
" </ram:ApplicableHeaderTradeSettlement>\n" +
|
||||
" </rsm:SupplyChainTradeTransaction>\n" +
|
||||
"</rsm:CrossIndustryInvoice>";
|
||||
zea1.setZUGFeRDXMLData(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
zea1.setXML(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
zea1.disableAutoClose(true);
|
||||
zea1.export(TARGET_PDF);
|
||||
@@ -297,11 +297,11 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
try {
|
||||
InputStream SOURCE_PDF = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1Factory()
|
||||
IZUGFeRDExporter zea1 = new ZUGFeRDExporterFromA1()
|
||||
.setProducer("My Application")
|
||||
.setCreator("Test")
|
||||
.setZUGFeRDVersion(1)
|
||||
.setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.BASIC)
|
||||
.setProfile(Profiles.BASIC)
|
||||
.load(SOURCE_PDF);
|
||||
/* we have much more information than just in the basic profile (comfort or extended) but it's perfectly valid to provide more information, just not less. */
|
||||
String ownZUGFeRDXML = "<rsm:CrossIndustryDocument xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:ram=\"urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:12\" xmlns:udt=\"urn:un:unece:uncefact:data:standard:UnqualifiedDataType:15\" xmlns:rsm=\"urn:ferd:CrossIndustryDocument:invoice:1p0\">\n"
|
||||
@@ -437,7 +437,7 @@ public class MustangReaderWriterCustomXMLTest extends TestCase {
|
||||
+ "<ram:Name>Heiße Luft pro Liter</ram:Name>\n" + "<ram:Description/>\n"
|
||||
+ "</ram:SpecifiedTradeProduct>\n" + "</ram:IncludedSupplyChainTradeLineItem>\n"
|
||||
+ "</rsm:SpecifiedSupplyChainTradeTransaction>\n" + "</rsm:CrossIndustryDocument>";
|
||||
zea1.setZUGFeRDXMLData(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
zea1.setXML(ownZUGFeRDXML.getBytes("UTF-8"));
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
zea1.disableAutoClose(true);
|
||||
|
||||
@@ -202,19 +202,19 @@ public class MustangReaderWriterEdgeTest extends MustangReaderTestCase {
|
||||
|
||||
try (InputStream SOURCE_PDF =
|
||||
this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory()
|
||||
) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA3()
|
||||
.setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name"))
|
||||
.setZUGFeRDVersion(1)
|
||||
.ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
ze.PDFattachZugferdFile(this);
|
||||
.load(SOURCE_PDF);
|
||||
ze.setTransaction(this);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryDocument"));
|
||||
ze.export(TARGET_PDF);
|
||||
} catch (IOException e) {
|
||||
fail("IOException should not happen in testEdgeExport");
|
||||
e.printStackTrace();
|
||||
fail("IOException should not happen in testEdgeExport ");
|
||||
}
|
||||
|
||||
// now check the contents (like MustangReaderTest)
|
||||
|
||||
@@ -304,7 +304,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setAttachZUGFeRDHeaders(false).load(SOURCE_PDF);
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setAttachZUGFeRDHeaders(false).load(SOURCE_PDF);
|
||||
|
||||
File tempFile = File.createTempFile("ZUGFeRD-", "-test");
|
||||
ze.export(tempFile.getAbsolutePath());
|
||||
@@ -317,7 +317,7 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setAttachZUGFeRDHeaders(false).load(SOURCE_PDF);
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setAttachZUGFeRDHeaders(false).load(SOURCE_PDF);
|
||||
|
||||
File tempFile = File.createTempFile("ZUGFeRD-", "-test");
|
||||
tempFile.deleteOnExit();
|
||||
@@ -358,9 +358,9 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile(Profiles.EN16931).load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
@@ -402,9 +402,9 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20190610_507blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(1).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.COMFORT).load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(1).setProfile(Profiles.COMFORT).load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
@@ -430,9 +430,8 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20171118_506blanko.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).load(SOURCE_PDF)) {
|
||||
ze.setFacturX();
|
||||
ze.PDFattachZugferdFile(this);
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().setZUGFeRDVersion(2).setProfile(Profiles.EN16931).load(SOURCE_PDF)) {
|
||||
ze.setTransaction(this);
|
||||
ze.disableAutoClose(true);
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
@@ -467,9 +466,9 @@ public class MustangReaderWriterTest extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDF14.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA1Factory().load(SOURCE_PDF)) {
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA1().load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
@@ -19,29 +19,18 @@
|
||||
* <p>
|
||||
* **********************************************************************
|
||||
*/
|
||||
package library.src.test.java.org.mustangproject.ZUGFeRD;
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import library.src.main.java.org.mustangproject.Contact;
|
||||
import library.src.main.java.org.mustangproject.Invoice;
|
||||
import library.src.main.java.org.mustangproject.Item;
|
||||
import library.src.main.java.org.mustangproject.Product;
|
||||
import org.mustangproject.Contact;
|
||||
import org.mustangproject.Invoice;
|
||||
import org.mustangproject.Item;
|
||||
import org.mustangproject.Product;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRD2PullProvider;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDExporter;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDExporterFromA3Factory;
|
||||
import org.mustangproject.ZUGFeRD.ZUGFeRDImporter;
|
||||
|
||||
|
||||
|
||||
import org.xmlunit.builder.Input;
|
||||
import org.xmlunit.xpath.JAXPXPathEngine;
|
||||
import org.xmlunit.xpath.XPathEngine;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
@@ -30,13 +30,12 @@ import java.util.GregorianCalendar;
|
||||
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
import org.mustangproject.ZUGFeRD.MustangReaderTestCase.Item;
|
||||
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExportableTransaction {
|
||||
public class ZF2EdgeTest extends MustangReaderTestCase implements IExportableTransaction {
|
||||
final String TARGET_PDF = "./target/testout-ZF2newEdge.pdf";
|
||||
|
||||
protected class EdgeProduct implements IZUGFeRDExportableProduct {
|
||||
@@ -266,12 +265,12 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExport
|
||||
// the writing part
|
||||
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory().setProducer("My Application")
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_PDF);
|
||||
@@ -316,10 +315,10 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IZUGFeRDExport
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
|
||||
IZUGFeRDExporter ze = new ZUGFeRDExporterFromA3().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).disableFacturX()
|
||||
.load(SOURCE_PDF)) {
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(bos);
|
||||
|
||||
@@ -24,17 +24,14 @@ import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import library.src.main.java.org.mustangproject.Contact;
|
||||
import library.src.main.java.org.mustangproject.Invoice;
|
||||
import library.src.main.java.org.mustangproject.Item;
|
||||
import library.src.main.java.org.mustangproject.Product;
|
||||
import org.mustangproject.Contact;
|
||||
import org.mustangproject.Invoice;
|
||||
import org.mustangproject.Item;
|
||||
import org.mustangproject.Product;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
|
||||
|
||||
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
|
||||
@@ -50,13 +47,13 @@ public class ZF2PushTest extends TestCase {
|
||||
String amountStr="1.00";
|
||||
BigDecimal amount=new BigDecimal(amountStr);
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory().setProducer("My Application")
|
||||
ZUGFeRDExporterFromA1 ze = new ZUGFeRDExporterFromA1().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).ignorePDFAErrors()
|
||||
.load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(new Invoice().setDueDate(new Date()).setIssueDate(new Date()).setDeliveryDate(new Date()).setOwnOrganisationName(orgname).setOwnStreet("teststr").setOwnZIP("55232").setOwnLocation("teststadt").setOwnCountry("DE").setOwnTaxID("4711").setOwnVATID("0815").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()).setOwnOrganisationName(orgname).setOwnStreet("teststr").setOwnZIP("55232").setOwnLocation("teststadt").setOwnCountry("DE").setOwnTaxID("4711").setOwnVATID("0815").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());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_PDF);
|
||||
|
||||
@@ -187,11 +187,11 @@ public class ZF2Test extends MustangReaderTestCase {
|
||||
try (InputStream SOURCE_PDF = this.getClass()
|
||||
.getResourceAsStream("/MustangGnuaccountingBeispielRE-20170509_505PDFA3.pdf");
|
||||
|
||||
ZUGFeRDExporter ze = new ZUGFeRDExporterFromA3Factory().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).setZUGFeRDConformanceLevel(ZUGFeRDConformanceLevel.EN16931).ignorePDFAErrors()
|
||||
ZUGFeRDExporterFromA3 ze = new ZUGFeRDExporterFromA3().setProducer("My Application")
|
||||
.setCreator(System.getProperty("user.name")).setZUGFeRDVersion(2).setProfile(Profiles.EN16931)
|
||||
.load(SOURCE_PDF)) {
|
||||
|
||||
ze.PDFattachZugferdFile(this);
|
||||
ze.setTransaction(this);
|
||||
String theXML = new String(ze.getProvider().getXML());
|
||||
assertTrue(theXML.contains("<rsm:CrossIndustryInvoice"));
|
||||
ze.export(TARGET_PDF);
|
||||
@@ -247,7 +247,7 @@ public class ZF2Test extends MustangReaderTestCase {
|
||||
assertEquals(zi.getSellerTradePartyAddress().getCountryID(), "DE");
|
||||
assertEquals(zi.getSellerTradePartyAddress().getCityName(), "Stadthausen");
|
||||
|
||||
List<library.src.main.java.org.mustangproject.Item> li = zi.getLineItemList();
|
||||
List<org.mustangproject.Item> li = zi.getLineItemList();
|
||||
assertEquals(zi.getLineItemList().get(0).getId().toString(), "1");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getBuyerAssignedID(), "");
|
||||
assertEquals(zi.getLineItemList().get(0).getProduct().getSellerAssignedID(), "");
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*********************************************************************** */
|
||||
package org.mustangproject.ZUGFeRD;
|
||||
|
||||
import library.src.main.java.org.mustangproject.Invoice;
|
||||
import org.mustangproject.Invoice;
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.runners.MethodSorters;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user