diff --git a/library/src/main/java/org/mustangproject/IncludedNote.java b/library/src/main/java/org/mustangproject/IncludedNote.java new file mode 100644 index 00000000..219f9e20 --- /dev/null +++ b/library/src/main/java/org/mustangproject/IncludedNote.java @@ -0,0 +1,42 @@ +package org.mustangproject; + +/** + * A grouping of business terms to indicate accounting-relevant free texts including a qualification of these. + */ +public class IncludedNote { + private final String content; + private final SubjectCode subjectCode; + + private IncludedNote(String content, SubjectCode subjectCode) { + this.content = content; + this.subjectCode = subjectCode; + } + + public static IncludedNote generalNote(String content) { + return new IncludedNote(content, SubjectCode.AAI); + } + public static IncludedNote regulatoryNote(String content) { + return new IncludedNote(content, SubjectCode.REG); + } + public static IncludedNote legalNote(String content) { + return new IncludedNote(content, SubjectCode.ABL); + } + public static IncludedNote customsNote(String content) { + return new IncludedNote(content, SubjectCode.CUS); + } + public static IncludedNote sellerNote(String content) { + return new IncludedNote(content, SubjectCode.SUR); + } + public static IncludedNote taxNote(String content) { + return new IncludedNote(content, SubjectCode.TXD); + } + + public String getContent() { + return content; + } + + public SubjectCode getSubjectCode() { + return subjectCode; + } + +} diff --git a/library/src/main/java/org/mustangproject/SubjectCode.java b/library/src/main/java/org/mustangproject/SubjectCode.java new file mode 100644 index 00000000..fb388c1f --- /dev/null +++ b/library/src/main/java/org/mustangproject/SubjectCode.java @@ -0,0 +1,31 @@ +package org.mustangproject; + +/** + * the qualification of the free text on the invoice from BT-22 + */ +public enum SubjectCode { + /** + * general information + */ + AAI, + /** + * seller notes + */ + SUR, + /** + * regulatory information + */ + REG, + /** + * legal information + */ + ABL, + /** + * tax information + */ + TXD, + /** + * Customs information + */ + CUS +} diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java b/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java index fb8fa602..bd778d78 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/IExportableTransaction.java @@ -29,8 +29,10 @@ package org.mustangproject.ZUGFeRD; import java.math.BigDecimal; import java.util.Date; +import java.util.List; import org.mustangproject.FileAttachment; +import org.mustangproject.IncludedNote; import org.mustangproject.ZUGFeRD.model.DocumentCodeTypeConstants; /*** @@ -80,10 +82,13 @@ public interface IExportableTransaction { /** * this should be the full sender institution name, details, manager and tax * registration. It is one of the few functions which may return null. e.g. - *

+ *

* Lieferant GmbH Lieferantenstraße 20 80333 München Deutschland * Geschäftsführer: Hans Muster Handelsregisternummer: H A 123 + *

* + * It is written as an includedNode with subjectCode {@link org.mustangproject.SubjectCode#REG}. See also + * {@link #getNotesWithSubjectCode()} * @return null or full sender institution name, details, manager and tax * registration */ @@ -489,6 +494,13 @@ public interface IExportableTransaction { return null; } + /** + * A grouping of business terms to indicate accounting-relevant free texts including a qualification of these.

+ * The information are written to the same xml nodes like {@link #getNotes()} but with explicit subjectCode. + */ + default List getNotesWithSubjectCode(){ + return null; + } default String getSpecifiedProcuringProjectName() { return null; }