diff --git a/History.md b/History.md
index a6893ccf..8cd80acb 100644
--- a/History.md
+++ b/History.md
@@ -1,6 +1,8 @@
2.4.1
=======
+DespatchAdviceReferencedDocument/IssuerAssignedID
+
- allow to specify legalorganisation ID+scheme ID
- allow to specify additional files to be attached in command line
- update to zf 2.2
diff --git a/library/src/main/java/org/mustangproject/Invoice.java b/library/src/main/java/org/mustangproject/Invoice.java
index 442aebeb..038020a4 100644
--- a/library/src/main/java/org/mustangproject/Invoice.java
+++ b/library/src/main/java/org/mustangproject/Invoice.java
@@ -56,8 +56,9 @@ public class Invoice implements IExportableTransaction {
protected Date invoiceReferencedIssueDate;
protected String specifiedProcuringProjectID = null;
protected String specifiedProcuringProjectName = null;
+ protected String despatchAdviceReferencedDocumentID = null;
- public Invoice() {
+ public Invoice() {
ZFItems = new ArrayList<>();
setCurrency("EUR");
}
@@ -667,6 +668,18 @@ public class Invoice implements IExportableTransaction {
return this;
}
+ @Override
+ public String getDespatchAdviceReferencedDocumentID() {
+ return despatchAdviceReferencedDocumentID;
+ }
+
+
+ public Invoice setDespatchAdviceReferencedDocumentID(String despatchAdviceReferencedDocumentID) {
+ this.despatchAdviceReferencedDocumentID = despatchAdviceReferencedDocumentID;
+ return this;
+ }
+
+
@Override
public String getSpecifiedProcuringProjectName() {
return specifiedProcuringProjectName;
diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java b/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java
index 1ce056e6..18a512af 100644
--- a/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java
+++ b/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java
@@ -481,7 +481,9 @@ public interface IExportableTransaction {
return null;
}
-
+ default String getDespatchAdviceReferencedDocumentID() {
+ return null;
+ }
/***
* additional text description
* @return an array of strings of document wide "includedNotes" (descriptive text values)
diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java
index 17248b92..f10abe4b 100644
--- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java
+++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java
@@ -512,16 +512,23 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
throw new IllegalStateException("No delivery date provided");
}
xml += "\n";
- xml += " \n"
+ xml += " \n";
+
/*
- * + " \n" +
- * " 20130603\n" +
- * " 2013-51112\n" +
- * " \n"
+ * + " \n" +
+ * " 20130603\n" +
+ * " 2013-51112\n" +
+ * " \n"
*/
- + " \n" + " \n"
- + " " + XMLTools.encodeXML(trans.getNumber()) + "\n"
- + " " + trans.getCurrency() + "\n";
+ if (trans.getDespatchAdviceReferencedDocumentID() != null) {
+ xml += "";
+ xml += ""+XMLTools.encodeXML(trans.getDespatchAdviceReferencedDocumentID())+"";
+ xml += "";
+
+ }
+ xml += " \n" + " \n"
+ + " " + XMLTools.encodeXML(trans.getNumber()) + "\n"
+ + " " + trans.getCurrency() + "\n";
if (trans.getTradeSettlementPayment() != null) {
for (final IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) {
diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2EdgeTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2EdgeTest.java
index ee3e1d42..54891fb2 100644
--- a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2EdgeTest.java
+++ b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2EdgeTest.java
@@ -257,6 +257,11 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IExportableTra
return "AB321";
}
+ @Override
+ public String getDespatchAdviceReferencedDocumentID() {
+ return "123";
+ }
+
/**
* Create the test case
*
@@ -311,6 +316,8 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IExportableTra
assertTrue(resultXML.contains(""));
assertFalse(resultXML.contains("EUR"));
assertTrue(resultXML.contains("USD"));//currency should be USD, test for #150
+ assertTrue(resultXML.contains(""));
+ assertTrue(resultXML.contains("123"));
// Reading ZUGFeRD
assertEquals("496.00", zi.getAmount());