DespatchAdviceID

This commit is contained in:
jstaerk
2022-03-21 15:30:24 +01:00
parent 58b13598b3
commit 3ee042df8a
5 changed files with 41 additions and 10 deletions

View File

@@ -1,6 +1,8 @@
2.4.1 2.4.1
======= =======
DespatchAdviceReferencedDocument/IssuerAssignedID
- allow to specify legalorganisation ID+scheme ID - allow to specify legalorganisation ID+scheme ID
- allow to specify additional files to be attached in command line - allow to specify additional files to be attached in command line
- update to zf 2.2 - update to zf 2.2

View File

@@ -56,8 +56,9 @@ public class Invoice implements IExportableTransaction {
protected Date invoiceReferencedIssueDate; protected Date invoiceReferencedIssueDate;
protected String specifiedProcuringProjectID = null; protected String specifiedProcuringProjectID = null;
protected String specifiedProcuringProjectName = null; protected String specifiedProcuringProjectName = null;
protected String despatchAdviceReferencedDocumentID = null;
public Invoice() { public Invoice() {
ZFItems = new ArrayList<>(); ZFItems = new ArrayList<>();
setCurrency("EUR"); setCurrency("EUR");
} }
@@ -667,6 +668,18 @@ public class Invoice implements IExportableTransaction {
return this; return this;
} }
@Override
public String getDespatchAdviceReferencedDocumentID() {
return despatchAdviceReferencedDocumentID;
}
public Invoice setDespatchAdviceReferencedDocumentID(String despatchAdviceReferencedDocumentID) {
this.despatchAdviceReferencedDocumentID = despatchAdviceReferencedDocumentID;
return this;
}
@Override @Override
public String getSpecifiedProcuringProjectName() { public String getSpecifiedProcuringProjectName() {
return specifiedProcuringProjectName; return specifiedProcuringProjectName;

View File

@@ -481,7 +481,9 @@ public interface IExportableTransaction {
return null; return null;
} }
default String getDespatchAdviceReferencedDocumentID() {
return null;
}
/*** /***
* additional text description * additional text description
* @return an array of strings of document wide "includedNotes" (descriptive text values) * @return an array of strings of document wide "includedNotes" (descriptive text values)

View File

@@ -512,16 +512,23 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
throw new IllegalStateException("No delivery date provided"); throw new IllegalStateException("No delivery date provided");
} }
xml += "</ram:OccurrenceDateTime>\n"; xml += "</ram:OccurrenceDateTime>\n";
xml += " </ram:ActualDeliverySupplyChainEvent>\n" xml += " </ram:ActualDeliverySupplyChainEvent>\n";
/* /*
* + " <DeliveryNoteReferencedDocument>\n" + * + " <DeliveryNoteReferencedDocument>\n" +
* " <IssueDateTime format=\"102\">20130603</IssueDateTime>\n" + * " <IssueDateTime format=\"102\">20130603</IssueDateTime>\n" +
* " <ID>2013-51112</ID>\n" + * " <ID>2013-51112</ID>\n" +
* " </DeliveryNoteReferencedDocument>\n" * " </DeliveryNoteReferencedDocument>\n"
*/ */
+ " </ram:ApplicableHeaderTradeDelivery>\n" + " <ram:ApplicableHeaderTradeSettlement>\n" if (trans.getDespatchAdviceReferencedDocumentID() != null) {
+ " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>\n" xml += "<ram:DespatchAdviceReferencedDocument>";
+ " <ram:InvoiceCurrencyCode>" + trans.getCurrency() + "</ram:InvoiceCurrencyCode>\n"; xml += "<ram:IssuerAssignedID>"+XMLTools.encodeXML(trans.getDespatchAdviceReferencedDocumentID())+"</ram:IssuerAssignedID>";
xml += "</ram:DespatchAdviceReferencedDocument>";
}
xml += " </ram:ApplicableHeaderTradeDelivery>\n" + " <ram:ApplicableHeaderTradeSettlement>\n"
+ " <ram:PaymentReference>" + XMLTools.encodeXML(trans.getNumber()) + "</ram:PaymentReference>\n"
+ " <ram:InvoiceCurrencyCode>" + trans.getCurrency() + "</ram:InvoiceCurrencyCode>\n";
if (trans.getTradeSettlementPayment() != null) { if (trans.getTradeSettlementPayment() != null) {
for (final IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) { for (final IZUGFeRDTradeSettlementPayment payment : trans.getTradeSettlementPayment()) {

View File

@@ -257,6 +257,11 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IExportableTra
return "AB321"; return "AB321";
} }
@Override
public String getDespatchAdviceReferencedDocumentID() {
return "123";
}
/** /**
* Create the test case * Create the test case
* *
@@ -311,6 +316,8 @@ public class ZF2EdgeTest extends MustangReaderTestCase implements IExportableTra
assertTrue(resultXML.contains("<ram:DueDateDateTime>")); assertTrue(resultXML.contains("<ram:DueDateDateTime>"));
assertFalse(resultXML.contains("EUR")); assertFalse(resultXML.contains("EUR"));
assertTrue(resultXML.contains("USD"));//currency should be USD, test for #150 assertTrue(resultXML.contains("USD"));//currency should be USD, test for #150
assertTrue(resultXML.contains("<ram:DespatchAdviceReferencedDocument>"));
assertTrue(resultXML.contains("<ram:IssuerAssignedID>123</ram:IssuerAssignedID>"));
// Reading ZUGFeRD // Reading ZUGFeRD
assertEquals("496.00", zi.getAmount()); assertEquals("496.00", zi.getAmount());