support included notes

This commit is contained in:
jstaerk
2020-11-04 20:51:22 +01:00
parent 9efb2204d5
commit 1243863368
7 changed files with 144 additions and 5 deletions

View File

@@ -27,6 +27,10 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
/***
* An invoice, with fluent setters
* @see IExportableTransaction if you want to implement an interface instead
*/
public class Invoice implements IExportableTransaction {
protected String documentName = null, documentCode = null, number = null, ownOrganisationFullPlaintextInfo = null, referenceNumber = null, shipToOrganisationID = null, shipToOrganisationName = null, shipToStreet = null, shipToZIP = null, shipToLocation = null, shipToCountry = null, buyerOrderReferencedDocumentID = null, buyerOrderReferencedDocumentIssueDateTime = null, ownForeignOrganisationID = null, ownOrganisationName = null, currency = null, paymentTermDescription = null;
@@ -34,6 +38,7 @@ public class Invoice implements IExportableTransaction {
protected BigDecimal totalPrepaidAmount = null;
protected TradeParty sender=null, recipient = null, deliveryAddress = null;
protected ArrayList<IZUGFeRDExportableItem> ZFItems = null;
protected ArrayList<String> notes = null;
protected String contractReferencedDocument = null;
protected Date occurrenceDateFrom = null;
@@ -266,6 +271,14 @@ public class Invoice implements IExportableTransaction {
}
@Override
public String[] getNotes() {
if (notes==null) {
return null;
}
return notes.toArray(new String[0]);
}
@Override
public String getCurrency() {
return currency;
@@ -492,4 +505,13 @@ public class Invoice implements IExportableTransaction {
}
}
public Invoice addNote(String text) {
if (notes==null) {
notes=new ArrayList<String>();
}
notes.add(text);
return this;
}
}