Issue #458 Allow multiple PaymentTerms for in Invoice

This commit is contained in:
Jens Nober
2024-08-30 09:15:25 +02:00
parent deea7c03cd
commit 68294ea9d2
7 changed files with 146 additions and 103 deletions

View File

@@ -28,6 +28,7 @@ import org.mustangproject.ZUGFeRD.*;
import org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
/***
@@ -56,7 +57,7 @@ public class Invoice implements IExportableTransaction {
protected ArrayList<IZUGFeRDAllowanceCharge> Allowances = new ArrayList<>(),
Charges = new ArrayList<>(), LogisticsServiceCharges = new ArrayList<>();
protected IZUGFeRDPaymentTerms paymentTerms = null;
protected IZUGFeRDPaymentTerms[] paymentTerms = null;
protected String invoiceReferencedDocumentID = null;
protected Date invoiceReferencedIssueDate;
@@ -641,15 +642,22 @@ public class Invoice implements IExportableTransaction {
@Override
public IZUGFeRDPaymentTerms getPaymentTerms() {
public IZUGFeRDPaymentTerms[] getPaymentTerms() {
return paymentTerms;
}
public Invoice setPaymentTerms(IZUGFeRDPaymentTerms paymentTerms) {
@JsonProperty
public Invoice setPaymentTerms(IZUGFeRDPaymentTerms[] paymentTerms) {
this.paymentTerms = paymentTerms;
return this;
}
public Invoice setPaymentTerms(IZUGFeRDPaymentTerms paymentTerms) {
this.paymentTerms = new IZUGFeRDPaymentTerms[] { paymentTerms };
return this;
}
@Override
public TradeParty getDeliveryAddress() {
return deliveryAddress;