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 Date detailedDeliveryDateStart = null;
|
||||
protected Date detailedDeliveryPeriodEnd = null;
|
||||
protected IDatedReference tenderReference = null;
|
||||
protected IReferencedDocument tenderReference = null;
|
||||
|
||||
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<>(),
|
||||
Charges = new ArrayList<>(), LogisticsServiceCharges = new ArrayList<>();
|
||||
@@ -151,7 +151,7 @@ public class Invoice implements IExportableTransaction {
|
||||
/***
|
||||
* BT-17
|
||||
*/
|
||||
public IDatedReference getTenderReferencedDocument() {
|
||||
public IReferencedDocument getTenderReferencedDocument() {
|
||||
return tenderReference;
|
||||
}
|
||||
|
||||
@@ -161,13 +161,13 @@ public class Invoice implements IExportableTransaction {
|
||||
* @param dr
|
||||
* @return
|
||||
*/
|
||||
public Invoice setTenderReferencedDocument(DatedReference dr) {
|
||||
public Invoice setTenderReferencedDocument(ReferencedDocument dr) {
|
||||
tenderReference=dr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Invoice setTenderReferencedDocument(String ID) {
|
||||
DatedReference dr=new DatedReference(ID);
|
||||
ReferencedDocument dr=new ReferencedDocument(ID);
|
||||
setTenderReferencedDocument(dr);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -3,10 +3,7 @@ package org.mustangproject;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import org.mustangproject.ZUGFeRD.IReferencedDocument;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
||||
import org.mustangproject.ZUGFeRD.IZUGFeRDExportableItem;
|
||||
import org.mustangproject.ZUGFeRD.LineCalculator;
|
||||
import org.mustangproject.ZUGFeRD.*;
|
||||
import org.mustangproject.util.NodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
@@ -38,6 +35,7 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
protected String id;
|
||||
protected String buyerOrderReferencedDocumentLineID = null;
|
||||
protected String buyerOrderReferencedDocumentID = null;
|
||||
protected IReferencedDocument tenderReferencedDocument=null;
|
||||
protected Product product;
|
||||
protected ArrayList<String> notes = null;
|
||||
protected ArrayList<ReferencedDocument> referencedDocuments = null;
|
||||
@@ -622,6 +620,16 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
return detailedDeliveryPeriodTo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IReferencedDocument getTenderReferencedDocument() {
|
||||
return tenderReferencedDocument;
|
||||
}
|
||||
|
||||
public Item getTenderReferencedDocument(IReferencedDocument idr) {
|
||||
tenderReferencedDocument=idr;
|
||||
return this;
|
||||
}
|
||||
|
||||
public IZUGFeRDExportableItem addNotes(Collection<IncludedNote> notes) {
|
||||
if (notes == null) {
|
||||
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
|
||||
*/
|
||||
default IDatedReference getTenderReferencedDocument() {
|
||||
default IReferencedDocument getTenderReferencedDocument() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -156,12 +156,20 @@ public interface IZUGFeRDExportableItem extends IAbsoluteValueProvider{
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* specifies the item level delivery period (there is also one on document level),
|
||||
* this will be included in a BillingSpecifiedPeriod element
|
||||
* @return the beginning of the delivery period
|
||||
* 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),
|
||||
* this will be included in a BillingSpecifiedPeriod element
|
||||
* @return the beginning of the delivery period
|
||||
*/
|
||||
default Date getDetailedDeliveryPeriodFrom() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -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)&&(!tenderReference.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 {
|
||||
zpp.setTenderReferencedDocument(tenderReference);
|
||||
}
|
||||
@@ -746,7 +746,7 @@ public class ZUGFeRDInvoiceImporter {
|
||||
if (typeC == 50) {
|
||||
if (additionalReferencedDocument != null){
|
||||
if (additionalReferencedDocumentDate!=null) {
|
||||
zpp.setTenderReferencedDocument(new DatedReference(additionalReferencedDocument, additionalReferencedDocumentDate));
|
||||
zpp.setTenderReferencedDocument(new ReferencedDocument(additionalReferencedDocument, additionalReferencedDocumentDate));
|
||||
} else {
|
||||
zpp.setTenderReferencedDocument(additionalReferencedDocument);
|
||||
}
|
||||
|
||||
@@ -145,14 +145,25 @@ public class ZF2EdgeTest extends MustangReaderTestCase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDatedReference getTenderReferencedDocument() {
|
||||
return new IDatedReference() {
|
||||
public IReferencedDocument getTenderReferencedDocument() {
|
||||
return new IReferencedDocument() {
|
||||
@Override
|
||||
public String getID() {
|
||||
public String getIssuerAssignedID() {
|
||||
return "983-jk-787";
|
||||
}
|
||||
|
||||
@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");
|
||||
try {
|
||||
return sdf.parse("2025-10-12");
|
||||
@@ -161,6 +172,7 @@ public class ZF2EdgeTest extends MustangReaderTestCase {
|
||||
}
|
||||
return null; // wont happen either
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user