Add more setter for notes
This commit is contained in:
@@ -30,6 +30,12 @@ public class IncludedNote {
|
||||
public static IncludedNote taxNote(String content) {
|
||||
return new IncludedNote(content, SubjectCode.TXD);
|
||||
}
|
||||
public static IncludedNote introductionNote(String content) {
|
||||
return new IncludedNote(content, SubjectCode.ACY);
|
||||
}
|
||||
public static IncludedNote discountBonusNote(String content) {
|
||||
return new IncludedNote(content, SubjectCode.AAK);
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
|
||||
@@ -699,7 +699,7 @@ public class Invoice implements IExportableTransaction {
|
||||
* @param content freeform UTF8 plain text
|
||||
* @return fluent setter
|
||||
*/
|
||||
public Invoice regulatoryNote(String content) {
|
||||
public Invoice addRegulatoryNote(String content) {
|
||||
if (includedNotes == null) {
|
||||
includedNotes = new ArrayList<>();
|
||||
}
|
||||
@@ -713,7 +713,7 @@ public class Invoice implements IExportableTransaction {
|
||||
* @param content freeform UTF8 plain text
|
||||
* @return fluent setter
|
||||
*/
|
||||
public Invoice legalNote(String content) {
|
||||
public Invoice addLegalNote(String content) {
|
||||
if (includedNotes == null) {
|
||||
includedNotes = new ArrayList<>();
|
||||
}
|
||||
@@ -727,7 +727,7 @@ public class Invoice implements IExportableTransaction {
|
||||
* @param content freeform UTF8 plain text
|
||||
* @return fluent setter
|
||||
*/
|
||||
public Invoice customsNote(String content) {
|
||||
public Invoice addCustomsNote(String content) {
|
||||
if (includedNotes == null) {
|
||||
includedNotes = new ArrayList<>();
|
||||
}
|
||||
@@ -741,7 +741,7 @@ public class Invoice implements IExportableTransaction {
|
||||
* @param content freeform UTF8 plain text
|
||||
* @return fluent setter
|
||||
*/
|
||||
public Invoice sellerNote(String content) {
|
||||
public Invoice addSellerNote(String content) {
|
||||
if (includedNotes == null) {
|
||||
includedNotes = new ArrayList<>();
|
||||
}
|
||||
@@ -755,7 +755,7 @@ public class Invoice implements IExportableTransaction {
|
||||
* @param content freeform UTF8 plain text
|
||||
* @return fluent setter
|
||||
*/
|
||||
public Invoice taxNote(String content) {
|
||||
public Invoice addTaxNote(String content) {
|
||||
if (includedNotes == null) {
|
||||
includedNotes = new ArrayList<>();
|
||||
}
|
||||
@@ -763,6 +763,33 @@ public class Invoice implements IExportableTransaction {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* adds a free text paragraph, which will become an includedNote element with explicit
|
||||
* subjectCode {@link SubjectCode#ACY}
|
||||
* @param content freeform UTF8 plain text
|
||||
* @return fluent setter
|
||||
*/
|
||||
public Invoice addIntroductionNote(String content) {
|
||||
if (includedNotes == null) {
|
||||
includedNotes = new ArrayList<>();
|
||||
}
|
||||
includedNotes.add(IncludedNote.introductionNote(content));
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* adds a free text paragraph, which will become an includedNote element with explicit
|
||||
* subjectCode {@link SubjectCode#AAK}
|
||||
* @param content freeform UTF8 plain text
|
||||
* @return fluent setter
|
||||
*/
|
||||
public Invoice addDiscountBonusNote(String content) {
|
||||
if (includedNotes == null) {
|
||||
includedNotes = new ArrayList<>();
|
||||
}
|
||||
includedNotes.add(IncludedNote.discountBonusNote(content));
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSpecifiedProcuringProjectID() {
|
||||
return specifiedProcuringProjectID;
|
||||
|
||||
@@ -27,5 +27,13 @@ public enum SubjectCode {
|
||||
/**
|
||||
* Customs information
|
||||
*/
|
||||
CUS
|
||||
CUS,
|
||||
/**
|
||||
* introduction
|
||||
*/
|
||||
ACY,
|
||||
/**
|
||||
* Discount and bonus agreements
|
||||
*/
|
||||
AAK
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.io.OutputFormat;
|
||||
import org.dom4j.io.XMLWriter;
|
||||
import org.mustangproject.FileAttachment;
|
||||
import org.mustangproject.SubjectCode;
|
||||
import org.mustangproject.XMLTools;
|
||||
import org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants;
|
||||
|
||||
@@ -753,13 +754,17 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
if (trans.rebateAgreementExists()) {
|
||||
notes.append("<ram:IncludedNote><ram:Content>")
|
||||
.append("Es bestehen Rabatt- und Bonusvereinbarungen.</ram:Content>")
|
||||
.append("<ram:SubjectCode>AAK</ram:SubjectCode></ram:IncludedNote>");
|
||||
.append("<ram:SubjectCode>")
|
||||
.append(SubjectCode.AAK)
|
||||
.append("</ram:SubjectCode></ram:IncludedNote>");
|
||||
}
|
||||
if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
|
||||
notes.append("<ram:IncludedNote><ram:Content>")
|
||||
.append(XMLTools.encodeXML(trans.getOwnOrganisationFullPlaintextInfo()))
|
||||
.append("</ram:Content>")
|
||||
.append("<ram:SubjectCode>REG</ram:SubjectCode></ram:IncludedNote>");
|
||||
.append("<ram:SubjectCode>")
|
||||
.append(SubjectCode.REG)
|
||||
.append("</ram:SubjectCode></ram:IncludedNote>");
|
||||
}
|
||||
if (trans.getSubjectNote() != null) {
|
||||
notes.append("<ram:IncludedNote><ram:Content>")
|
||||
|
||||
Reference in New Issue
Block a user