reverting redundant BT-128 changes
This commit is contained in:
@@ -35,7 +35,6 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
protected String id;
|
||||
protected String buyerOrderReferencedDocumentLineID = null;
|
||||
protected String buyerOrderReferencedDocumentID = null;
|
||||
protected ReferencedDocument tenderReferencedDocument=null;
|
||||
protected Product product;
|
||||
protected ArrayList<String> notes = null;
|
||||
protected ArrayList<ReferencedDocument> referencedDocuments = null;
|
||||
@@ -132,28 +131,7 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
product = new Product();
|
||||
}
|
||||
}
|
||||
itemMap.getAsNodeMap("DocumentReference").ifPresent(drnm -> {
|
||||
// BT-128
|
||||
ReferencedDocument rd=getTenderReferencedDocument();
|
||||
if (rd==null) {
|
||||
rd=new ReferencedDocument();
|
||||
}
|
||||
Node idNode=drnm.getNode("ID").get();
|
||||
if (idNode!=null) {
|
||||
rd.setIssuerAssignedID(idNode.getTextContent());
|
||||
Node schemeIDAttr;
|
||||
|
||||
schemeIDAttr=idNode.getAttributes().getNamedItem("schemeID");
|
||||
if (schemeIDAttr!=null) {
|
||||
rd.setReferenceTypeCode(schemeIDAttr.getNodeValue());
|
||||
}
|
||||
}
|
||||
|
||||
drnm.getAsString("DocumentTypeCode").ifPresent(rd::setTypeCode);
|
||||
if (rd!=null) {
|
||||
setTenderReferencedDocument(rd);
|
||||
}
|
||||
});
|
||||
|
||||
itemMap.getAsNodeMap("SpecifiedLineTradeAgreement", "SpecifiedSupplyChainTradeAgreement").ifPresent(icnm -> {
|
||||
icnm.getAsNodeMap("BuyerOrderReferencedDocument")
|
||||
@@ -645,21 +623,6 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
return detailedDeliveryPeriodTo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReferencedDocument getTenderReferencedDocument() {
|
||||
return tenderReferencedDocument;
|
||||
}
|
||||
|
||||
public Item setTenderReferencedDocument(ReferencedDocument idr) {
|
||||
tenderReferencedDocument=idr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Item setTenderReferencedDocument(String id) {
|
||||
ReferencedDocument rd=new ReferencedDocument(id);
|
||||
setTenderReferencedDocument(rd);
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableItem addNotes(Collection<IncludedNote> notes) {
|
||||
if (notes == null) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.mustangproject;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.mustangproject.ZUGFeRD.IReferencedDocument;
|
||||
@@ -40,7 +41,7 @@ public class ReferencedDocument implements IReferencedDocument {
|
||||
this(issuerAssingedID);
|
||||
this.formattedIssueDateTime = formattedIssueDateTime;
|
||||
}
|
||||
|
||||
|
||||
public ReferencedDocument(String issuerAssignedID) {
|
||||
this.issuerAssignedID = issuerAssignedID;
|
||||
}
|
||||
@@ -55,6 +56,7 @@ public class ReferencedDocument implements IReferencedDocument {
|
||||
|
||||
/**
|
||||
* which type is the document? e.g. "916" for additional invoice related
|
||||
*
|
||||
* @param typeCode as String, e.g. 916
|
||||
*/
|
||||
public void setTypeCode(String typeCode) {
|
||||
@@ -63,6 +65,7 @@ public class ReferencedDocument implements IReferencedDocument {
|
||||
|
||||
/**
|
||||
* type of the reference of this line, a UNTDID 1153 code
|
||||
*
|
||||
* @param referenceTypeCode three uppercase character reference type code as string
|
||||
*/
|
||||
public void setReferenceTypeCode(String referenceTypeCode) {
|
||||
@@ -94,8 +97,7 @@ public class ReferencedDocument implements IReferencedDocument {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Date getFormattedIssueDateTime()
|
||||
{
|
||||
public Date getFormattedIssueDateTime() {
|
||||
return formattedIssueDateTime;
|
||||
}
|
||||
|
||||
@@ -104,9 +106,20 @@ public class ReferencedDocument implements IReferencedDocument {
|
||||
return null;
|
||||
}
|
||||
NodeMap nodes = new NodeMap(node);
|
||||
return new ReferencedDocument(nodes.getAsStringOrNull("IssuerAssignedID", "ID"),
|
||||
ReferencedDocument rd = new ReferencedDocument(nodes.getAsStringOrNull("IssuerAssignedID", "ID"),
|
||||
nodes.getAsStringOrNull("TypeCode", "DocumentTypeCode"),
|
||||
nodes.getAsStringOrNull("ReferenceTypeCode"),
|
||||
XMLTools.tryDate(nodes.getAsStringOrNull("FormattedIssueDateTime")));
|
||||
if (nodes.getAsStringOrNull("ID") != null) {
|
||||
//sure sign for UBL: here ReferenceTypeCode is no element but a "schemeID" attribute to ID
|
||||
Node idNode = nodes.getNode("ID").get();
|
||||
if (idNode != null) {
|
||||
Node schemeIDAttr = idNode.getAttributes().getNamedItem("schemeID");
|
||||
if (schemeIDAttr != null) {
|
||||
rd.setReferenceTypeCode(schemeIDAttr.getNodeValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
return rd;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,14 +156,6 @@ public interface IZUGFeRDExportableItem extends IAbsoluteValueProvider{
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* tender reference on line level BT-128
|
||||
* @return BT-17 on line level
|
||||
*/
|
||||
default IReferencedDocument getTenderReferencedDocument() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
* specifies the item level delivery period (there is also one on document level),
|
||||
|
||||
Reference in New Issue
Block a user