using IReferencedDocument instead of IDatedReference
This commit is contained in:
@@ -1,46 +0,0 @@
|
|||||||
package org.mustangproject;
|
|
||||||
|
|
||||||
import org.mustangproject.ZUGFeRD.IDatedReference;
|
|
||||||
|
|
||||||
import java.beans.BeanProperty;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class DatedReference implements IDatedReference {
|
|
||||||
|
|
||||||
protected String ID;
|
|
||||||
protected Date opDate;
|
|
||||||
|
|
||||||
public DatedReference setDate(Date opDate) {
|
|
||||||
this.opDate = opDate;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DatedReference setID(String ID) {
|
|
||||||
this.ID = ID;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DatedReference() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public DatedReference(String ID) {
|
|
||||||
setID(ID);
|
|
||||||
}
|
|
||||||
|
|
||||||
public DatedReference(String ID, Date theDate) {
|
|
||||||
setID(ID);
|
|
||||||
setDate(theDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getID() {
|
|
||||||
return ID;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Date getDate() {
|
|
||||||
return opDate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -54,7 +54,7 @@ public class Invoice implements IExportableTransaction {
|
|||||||
protected BigDecimal totalPrepaidAmount = null;
|
protected BigDecimal totalPrepaidAmount = null;
|
||||||
protected Date detailedDeliveryDateStart = null;
|
protected Date detailedDeliveryDateStart = null;
|
||||||
protected Date detailedDeliveryPeriodEnd = null;
|
protected Date detailedDeliveryPeriodEnd = null;
|
||||||
protected IDatedReference tenderReference = null;
|
protected IReferencedDocument tenderReference = null;
|
||||||
|
|
||||||
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<>(),
|
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<>(),
|
||||||
Charges = new ArrayList<>(), LogisticsServiceCharges = new ArrayList<>();
|
Charges = new ArrayList<>(), LogisticsServiceCharges = new ArrayList<>();
|
||||||
@@ -151,7 +151,7 @@ public class Invoice implements IExportableTransaction {
|
|||||||
/***
|
/***
|
||||||
* BT-17
|
* BT-17
|
||||||
*/
|
*/
|
||||||
public IDatedReference getTenderReferencedDocument() {
|
public IReferencedDocument getTenderReferencedDocument() {
|
||||||
return tenderReference;
|
return tenderReference;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,13 +161,13 @@ public class Invoice implements IExportableTransaction {
|
|||||||
* @param dr
|
* @param dr
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Invoice setTenderReferencedDocument(DatedReference dr) {
|
public Invoice setTenderReferencedDocument(ReferencedDocument dr) {
|
||||||
tenderReference=dr;
|
tenderReference=dr;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Invoice setTenderReferencedDocument(String ID) {
|
public Invoice setTenderReferencedDocument(String ID) {
|
||||||
DatedReference dr=new DatedReference(ID);
|
ReferencedDocument dr=new ReferencedDocument(ID);
|
||||||
setTenderReferencedDocument(dr);
|
setTenderReferencedDocument(dr);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,7 @@ package org.mustangproject;
|
|||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import org.mustangproject.ZUGFeRD.IReferencedDocument;
|
import org.mustangproject.ZUGFeRD.*;
|
||||||
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
|
||||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableItem;
|
|
||||||
import org.mustangproject.ZUGFeRD.LineCalculator;
|
|
||||||
import org.mustangproject.util.NodeMap;
|
import org.mustangproject.util.NodeMap;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
@@ -38,6 +35,7 @@ public class Item implements IZUGFeRDExportableItem {
|
|||||||
protected String id;
|
protected String id;
|
||||||
protected String buyerOrderReferencedDocumentLineID = null;
|
protected String buyerOrderReferencedDocumentLineID = null;
|
||||||
protected String buyerOrderReferencedDocumentID = null;
|
protected String buyerOrderReferencedDocumentID = null;
|
||||||
|
protected IReferencedDocument tenderReferencedDocument=null;
|
||||||
protected Product product;
|
protected Product product;
|
||||||
protected ArrayList<String> notes = null;
|
protected ArrayList<String> notes = null;
|
||||||
protected ArrayList<ReferencedDocument> referencedDocuments = null;
|
protected ArrayList<ReferencedDocument> referencedDocuments = null;
|
||||||
@@ -622,6 +620,16 @@ public class Item implements IZUGFeRDExportableItem {
|
|||||||
return detailedDeliveryPeriodTo;
|
return detailedDeliveryPeriodTo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IReferencedDocument getTenderReferencedDocument() {
|
||||||
|
return tenderReferencedDocument;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Item getTenderReferencedDocument(IReferencedDocument idr) {
|
||||||
|
tenderReferencedDocument=idr;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public IZUGFeRDExportableItem addNotes(Collection<IncludedNote> notes) {
|
public IZUGFeRDExportableItem addNotes(Collection<IncludedNote> notes) {
|
||||||
if (notes == null) {
|
if (notes == null) {
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
package org.mustangproject.ZUGFeRD;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public interface IDatedReference {
|
|
||||||
public String getID();
|
|
||||||
default Date getDate() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -219,7 +219,7 @@ public interface IExportableTransaction {
|
|||||||
*
|
*
|
||||||
* @return mandatory ID, optional Date
|
* @return mandatory ID, optional Date
|
||||||
*/
|
*/
|
||||||
default IDatedReference getTenderReferencedDocument() {
|
default IReferencedDocument getTenderReferencedDocument() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -156,6 +156,14 @@ 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),
|
* specifies the item level delivery period (there is also one on document level),
|
||||||
|
|||||||
@@ -612,7 +612,7 @@ public class ZUGFeRDInvoiceImporter {
|
|||||||
//if (tenderReference!=null) zpp... @todo bt-17 create a ubl with a date and set up an according xpath and if only tenderReference!=null only set that but if tenderReference!=null&&date!=null set both in zpp
|
//if (tenderReference!=null) zpp... @todo bt-17 create a ubl with a date and set up an according xpath and if only tenderReference!=null only set that but if tenderReference!=null&&date!=null set both in zpp
|
||||||
if((tenderReference != null)&&(!tenderReference.isEmpty())){
|
if((tenderReference != null)&&(!tenderReference.isEmpty())){
|
||||||
if((tenderReferenceDate != null)&&(!tenderReferenceDate.isEmpty())){
|
if((tenderReferenceDate != null)&&(!tenderReferenceDate.isEmpty())){
|
||||||
zpp.setTenderReferencedDocument(new DatedReference(tenderReference, parseDate(tenderReferenceDate, "yyyy-MM-dd")));
|
zpp.setTenderReferencedDocument(new ReferencedDocument(tenderReference, parseDate(tenderReferenceDate, "yyyy-MM-dd")));
|
||||||
} else {
|
} else {
|
||||||
zpp.setTenderReferencedDocument(tenderReference);
|
zpp.setTenderReferencedDocument(tenderReference);
|
||||||
}
|
}
|
||||||
@@ -746,7 +746,7 @@ public class ZUGFeRDInvoiceImporter {
|
|||||||
if (typeC == 50) {
|
if (typeC == 50) {
|
||||||
if (additionalReferencedDocument != null){
|
if (additionalReferencedDocument != null){
|
||||||
if (additionalReferencedDocumentDate!=null) {
|
if (additionalReferencedDocumentDate!=null) {
|
||||||
zpp.setTenderReferencedDocument(new DatedReference(additionalReferencedDocument, additionalReferencedDocumentDate));
|
zpp.setTenderReferencedDocument(new ReferencedDocument(additionalReferencedDocument, additionalReferencedDocumentDate));
|
||||||
} else {
|
} else {
|
||||||
zpp.setTenderReferencedDocument(additionalReferencedDocument);
|
zpp.setTenderReferencedDocument(additionalReferencedDocument);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -145,14 +145,25 @@ public class ZF2EdgeTest extends MustangReaderTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IDatedReference getTenderReferencedDocument() {
|
public IReferencedDocument getTenderReferencedDocument() {
|
||||||
return new IDatedReference() {
|
return new IReferencedDocument() {
|
||||||
@Override
|
@Override
|
||||||
public String getID() {
|
public String getIssuerAssignedID() {
|
||||||
return "983-jk-787";
|
return "983-jk-787";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Date getDate() {
|
public String getTypeCode() {
|
||||||
|
return "50";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getReferenceTypeCode() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Date getFormattedIssueDateTime() {
|
||||||
SimpleDateFormat sdf=new SimpleDateFormat("YYYY-mm-dd");
|
SimpleDateFormat sdf=new SimpleDateFormat("YYYY-mm-dd");
|
||||||
try {
|
try {
|
||||||
return sdf.parse("2025-10-12");
|
return sdf.parse("2025-10-12");
|
||||||
@@ -161,6 +172,7 @@ public class ZF2EdgeTest extends MustangReaderTestCase {
|
|||||||
}
|
}
|
||||||
return null; // wont happen either
|
return null; // wont happen either
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user