diff --git a/library/src/main/java/org/mustangproject/Contact.java b/library/src/main/java/org/mustangproject/Contact.java index 08e57772..455b66bd 100644 --- a/library/src/main/java/org/mustangproject/Contact.java +++ b/library/src/main/java/org/mustangproject/Contact.java @@ -51,21 +51,22 @@ public class Contact implements IZUGFeRDExportableContact { /*** * XML parsing constructor * @param nodes the nodelist returned e.g. from xpath - * - * e.g. sth like - * - * Name - * - * 069 100-0 - * - * - * test@example.com - * - * */ public Contact(NodeList nodes) { if (nodes.getLength() > 0) { + /* + will parse sth like + + Name + + 069 100-0 + + + test@example.com + + + */ for (int nodeIndex = 0; nodeIndex < nodes.getLength(); nodeIndex++) { //nodes.item(i).getTextContent())) { Node currentItemNode = nodes.item(nodeIndex); diff --git a/library/src/main/java/org/mustangproject/ReferencedDocument.java b/library/src/main/java/org/mustangproject/ReferencedDocument.java index 9653ebd4..02dcaf80 100644 --- a/library/src/main/java/org/mustangproject/ReferencedDocument.java +++ b/library/src/main/java/org/mustangproject/ReferencedDocument.java @@ -14,14 +14,32 @@ public class ReferencedDocument implements IReferencedDocument { this.referenceTypeCode = referenceTypeCode; } + public ReferencedDocument(String issuerAssignedID, String referenceTypeCode) { + this.issuerAssignedID = issuerAssignedID; + this.typeCode = "916"; // additional invoice related document + this.referenceTypeCode = referenceTypeCode; + } + + /*** + * sets an ID assigned by the sender + * @param issuerAssignedID + */ public void setIssuerAssignedID(String issuerAssignedID) { this.issuerAssignedID = issuerAssignedID; } + /** + * which type is the document? e.g. "916" for additional invoice related + * @param typeCode + */ public void setTypeCode(String typeCode) { this.typeCode = typeCode; } + /** + * type of the reference of this line, a UNTDID 1153 code + * @param referenceTypeCode + */ public void setReferenceTypeCode(String referenceTypeCode) { this.referenceTypeCode = referenceTypeCode; } diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/IReferencedDocument.java b/library/src/main/java/org/mustangproject/ZUGFeRD/IReferencedDocument.java index a78852c1..9d46d9b6 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/IReferencedDocument.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/IReferencedDocument.java @@ -1,8 +1,23 @@ package org.mustangproject.ZUGFeRD; public interface IReferencedDocument { + + /*** + * sets an ID assigned by the sender + * @return String of an ID + */ String getIssuerAssignedID(); + + /*** + * which type is the document? e.g. "916" for additional invoice related + * @return string of a most likely numeric code + */ String getTypeCode(); + + /*** + * type of the reference of this line, a UNTDID 1153 code + * @return String of a code + */ String getReferenceTypeCode(); }