diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java
index 912e35e1..30da37cd 100644
--- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java
+++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java
@@ -277,7 +277,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
boolean hasDueDate = false;
final SimpleDateFormat germanDateFormat = new SimpleDateFormat("dd.MM.yyyy");
-
+
String exemptionReason = "";
if (trans.getPaymentTermDescription() != null) {
@@ -288,42 +288,13 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
paymentTermsDescription = "Zahlbar ohne Abzug bis " + germanDateFormat.format(trans.getDueDate());
}
-
- String senderReg = "";
- if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
- senderReg = ""
- + XMLTools.encodeXML(trans.getOwnOrganisationFullPlaintextInfo()) + ""
- + "REG";
-
- }
-
- String rebateAgreement = "";
- if (trans.rebateAgreementExists()) {
- rebateAgreement = ""
- + "Es bestehen Rabatt- und Bonusvereinbarungen."
- + "AAK";
- }
-
- String subjectNote = "";
- if (trans.getSubjectNote() != null) {
- subjectNote = ""
- + XMLTools.encodeXML(trans.getSubjectNote()) + ""
- + "";
- }
-
+
String typecode = "380";
if (trans.getDocumentCode() != null) {
typecode = trans.getDocumentCode();
}
- String notes = "";
- if (trans.getNotes() != null) {
- for (final String currentNote : trans.getNotes()) {
- notes = notes + "" + XMLTools.encodeXML(currentNote) + "";
-
- }
- }
- String xml = ""
-
+ String notes;
+ String xml = ""
+ "" + typecode + ""
+ ""
+ DATE.udtFormat(trans.getIssueDate()) + "" // date
- + notes
- + subjectNote
- + rebateAgreement
- + senderReg
+ + buildNotes(trans)
+ ""
+ "";
@@ -364,7 +332,6 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
if (currentItem.getNotes() != null) {
for (final String currentNote : currentItem.getNotes()) {
notes = notes + "" + XMLTools.encodeXML(currentNote) + "";
-
}
}
final LineCalculator lc = new LineCalculator(currentItem);
@@ -647,8 +614,6 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
xml += "" + DATE.udtFormat(trans.getDetailedDeliveryPeriodTo()) + "";
}
xml += "";
-
-
}
if ((trans.getZFCharges() != null) && (trans.getZFCharges().length > 0)) {
@@ -776,7 +741,32 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
}
}
- @Override
+ private static String buildNotes(IExportableTransaction trans) {
+ String notes = "";
+ if (trans.getNotes() != null) {
+ for (final String currentNote : trans.getNotes()) {
+ notes += "" + XMLTools.encodeXML(currentNote) + "";
+ }
+ }
+ if (trans.rebateAgreementExists()) {
+ notes += ""
+ + "Es bestehen Rabatt- und Bonusvereinbarungen."
+ + "AAK";
+ }
+ if (trans.getOwnOrganisationFullPlaintextInfo() != null) {
+ notes += ""
+ + XMLTools.encodeXML(trans.getOwnOrganisationFullPlaintextInfo()) + ""
+ + "REG";
+ }
+ if (trans.getSubjectNote() != null) {
+ notes += ""
+ + XMLTools.encodeXML(trans.getSubjectNote()) + ""
+ + "";
+ }
+ return notes;
+ }
+
+ @Override
public void setProfile(Profile p) {
profile = p;
}