Implement Invoice#getNotesWithSubjectCode and convenient setter methods.
This commit is contained in:
@@ -23,6 +23,7 @@ package org.mustangproject;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.mustangproject.ZUGFeRD.IExportableTransaction;
|
import org.mustangproject.ZUGFeRD.IExportableTransaction;
|
||||||
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
import org.mustangproject.ZUGFeRD.IZUGFeRDAllowanceCharge;
|
||||||
@@ -48,6 +49,7 @@ public class Invoice implements IExportableTransaction {
|
|||||||
@JsonDeserialize(contentAs=Item.class)
|
@JsonDeserialize(contentAs=Item.class)
|
||||||
protected ArrayList<IZUGFeRDExportableItem> ZFItems = null;
|
protected ArrayList<IZUGFeRDExportableItem> ZFItems = null;
|
||||||
protected ArrayList<String> notes = null;
|
protected ArrayList<String> notes = null;
|
||||||
|
private List<IncludedNote> includedNotes = null;
|
||||||
protected String sellerOrderReferencedDocumentID;
|
protected String sellerOrderReferencedDocumentID;
|
||||||
protected String contractReferencedDocument = null;
|
protected String contractReferencedDocument = null;
|
||||||
protected ArrayList<FileAttachment> xmlEmbeddedFiles=null;
|
protected ArrayList<FileAttachment> xmlEmbeddedFiles=null;
|
||||||
@@ -396,6 +398,11 @@ public class Invoice implements IExportableTransaction {
|
|||||||
return notes.toArray(new String[0]);
|
return notes.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<IncludedNote> getNotesWithSubjectCode() {
|
||||||
|
return includedNotes;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCurrency() {
|
public String getCurrency() {
|
||||||
return currency;
|
return currency;
|
||||||
@@ -659,8 +666,8 @@ public class Invoice implements IExportableTransaction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***
|
/**
|
||||||
* adds a free text paragraph, which will become a includedNote element
|
* adds a free text paragraph, which will become an includedNote element
|
||||||
* @param text freeform UTF8 plain text
|
* @param text freeform UTF8 plain text
|
||||||
* @return fluent setter
|
* @return fluent setter
|
||||||
*/
|
*/
|
||||||
@@ -672,6 +679,90 @@ public class Invoice implements IExportableTransaction {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds a free text paragraph, which will become an includedNote element with explicit
|
||||||
|
* subjectCode {@link SubjectCode#AAI}
|
||||||
|
* @param content freeform UTF8 plain text
|
||||||
|
* @return fluent setter
|
||||||
|
*/
|
||||||
|
public Invoice addGeneralNote(String content) {
|
||||||
|
if (includedNotes == null) {
|
||||||
|
includedNotes = new ArrayList<>();
|
||||||
|
}
|
||||||
|
includedNotes.add(IncludedNote.generalNote(content));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds a free text paragraph, which will become an includedNote element with explicit
|
||||||
|
* subjectCode {@link SubjectCode#REG}
|
||||||
|
* @param content freeform UTF8 plain text
|
||||||
|
* @return fluent setter
|
||||||
|
*/
|
||||||
|
public Invoice regulatoryNote(String content) {
|
||||||
|
if (includedNotes == null) {
|
||||||
|
includedNotes = new ArrayList<>();
|
||||||
|
}
|
||||||
|
includedNotes.add(IncludedNote.regulatoryNote(content));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds a free text paragraph, which will become an includedNote element with explicit
|
||||||
|
* subjectCode {@link SubjectCode#ABL}
|
||||||
|
* @param content freeform UTF8 plain text
|
||||||
|
* @return fluent setter
|
||||||
|
*/
|
||||||
|
public Invoice legalNote(String content) {
|
||||||
|
if (includedNotes == null) {
|
||||||
|
includedNotes = new ArrayList<>();
|
||||||
|
}
|
||||||
|
includedNotes.add(IncludedNote.legalNote(content));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds a free text paragraph, which will become an includedNote element with explicit
|
||||||
|
* subjectCode {@link SubjectCode#CUS}
|
||||||
|
* @param content freeform UTF8 plain text
|
||||||
|
* @return fluent setter
|
||||||
|
*/
|
||||||
|
public Invoice customsNote(String content) {
|
||||||
|
if (includedNotes == null) {
|
||||||
|
includedNotes = new ArrayList<>();
|
||||||
|
}
|
||||||
|
includedNotes.add(IncludedNote.customsNote(content));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds a free text paragraph, which will become an includedNote element with explicit
|
||||||
|
* subjectCode {@link SubjectCode#SUR}
|
||||||
|
* @param content freeform UTF8 plain text
|
||||||
|
* @return fluent setter
|
||||||
|
*/
|
||||||
|
public Invoice sellerNote(String content) {
|
||||||
|
if (includedNotes == null) {
|
||||||
|
includedNotes = new ArrayList<>();
|
||||||
|
}
|
||||||
|
includedNotes.add(IncludedNote.sellerNote(content));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* adds a free text paragraph, which will become an includedNote element with explicit
|
||||||
|
* subjectCode {@link SubjectCode#TXD}
|
||||||
|
* @param content freeform UTF8 plain text
|
||||||
|
* @return fluent setter
|
||||||
|
*/
|
||||||
|
public Invoice taxNote(String content) {
|
||||||
|
if (includedNotes == null) {
|
||||||
|
includedNotes = new ArrayList<>();
|
||||||
|
}
|
||||||
|
includedNotes.add(IncludedNote.taxNote(content));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getSpecifiedProcuringProjectID() {
|
public String getSpecifiedProcuringProjectID() {
|
||||||
return specifiedProcuringProjectID;
|
return specifiedProcuringProjectID;
|
||||||
|
|||||||
Reference in New Issue
Block a user