add fax number to contact. Allow access to lineTwo(additionaladdress)
This commit is contained in:
@@ -5,6 +5,7 @@ import org.mustangproject.ZUGFeRD.IZUGFeRDExportableContact;
|
||||
public class Contact implements IZUGFeRDExportableContact {
|
||||
|
||||
protected String name,phone,email,zip,street,location,country;
|
||||
protected String fax=null;
|
||||
|
||||
public Contact(String name, String phone, String email) {
|
||||
this.name = name;
|
||||
@@ -43,6 +44,16 @@ public class Contact implements IZUGFeRDExportableContact {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFax() {
|
||||
return fax;
|
||||
}
|
||||
|
||||
public Contact setFax(String fax) {
|
||||
this.fax = fax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getEMail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@ import org.mustangproject.ZUGFeRD.IZUGFeRDTradeSettlement;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import javax.xml.xpath.XPathConstants;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
|
||||
protected String name, zip, street, location, country;
|
||||
protected String taxID = null, vatID = null;
|
||||
protected String additionalAddress = null;
|
||||
protected ArrayList<BankDetails> bankDetails = new ArrayList<BankDetails>();
|
||||
protected Contact contact = null;
|
||||
|
||||
@@ -66,6 +66,9 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
if (postal.item(postalChildIndex).getNodeName().equals("ram:LineOne")) {
|
||||
setStreet(postal.item(postalChildIndex).getTextContent());
|
||||
}
|
||||
if (postal.item(postalChildIndex).getNodeName().equals("ram:LineTwo")) {
|
||||
setAdditionalAddress(postal.item(postalChildIndex).getTextContent());
|
||||
}
|
||||
if (postal.item(postalChildIndex).getNodeName().equals("ram:CityName")) {
|
||||
setLocation(postal.item(postalChildIndex).getTextContent());
|
||||
}
|
||||
@@ -188,4 +191,15 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
||||
}
|
||||
return bankDetails.toArray(new IZUGFeRDTradeSettlement[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAdditionalAddress() {
|
||||
return additionalAddress;
|
||||
}
|
||||
|
||||
public TradeParty setAdditionalAddress(String additionalAddress) {
|
||||
this.additionalAddress = additionalAddress;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,11 +51,15 @@ public interface IZUGFeRDExportableContact {
|
||||
default String getPhone() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
default String getEMail() {
|
||||
return null;
|
||||
}
|
||||
|
||||
default String getFax() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Postal code of the recipient
|
||||
|
||||
@@ -235,12 +235,20 @@ public class ZUGFeRD2PullProvider implements IXMLProvider, IAbsoluteValueProvide
|
||||
+ XMLTools.encodeXML(party.getContact().getPhone()) + "</ram:CompleteNumber>\n"
|
||||
+ " </ram:TelephoneUniversalCommunication>\n";
|
||||
}
|
||||
|
||||
if (party.getContact().getFax() != null) {
|
||||
|
||||
xml = xml + " <ram:FaxUniversalCommunication>\n" + " <ram:CompleteNumber>"
|
||||
+ XMLTools.encodeXML(party.getContact().getFax()) + "</ram:CompleteNumber>\n"
|
||||
+ " </ram:FaxUniversalCommunication>\n";
|
||||
}
|
||||
if (party.getContact().getEMail() != null) {
|
||||
|
||||
xml = xml + " <ram:EmailURIUniversalCommunication>\n" + " <ram:URIID>"
|
||||
+ XMLTools.encodeXML(party.getContact().getEMail()) + "</ram:URIID>\n"
|
||||
+ " </ram:EmailURIUniversalCommunication>\n";
|
||||
}
|
||||
|
||||
xml = xml + " </ram:DefinedTradeContact>";
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user