Add URIUniversalCommunication to TradeParty
This commit is contained in:
@@ -31,6 +31,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
protected Contact contact = null;
|
protected Contact contact = null;
|
||||||
protected LegalOrganisation legalOrg = null;
|
protected LegalOrganisation legalOrg = null;
|
||||||
protected SchemedID globalId=null;
|
protected SchemedID globalId=null;
|
||||||
|
protected SchemedID uriUniversalCommunicationId=null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
@@ -192,6 +193,27 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUriUniversalCommunicationID() {
|
||||||
|
if (uriUniversalCommunicationId!=null) {
|
||||||
|
return uriUniversalCommunicationId.getID();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getUriUniversalCommunicationIDScheme() {
|
||||||
|
if (uriUniversalCommunicationId!=null) {
|
||||||
|
return uriUniversalCommunicationId.getScheme();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* if it's a customer, this can e.g. be the customer ID
|
* if it's a customer, this can e.g. be the customer ID
|
||||||
@@ -219,6 +241,11 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
globalId=schemedID;
|
globalId=schemedID;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TradeParty addUriUniversalCommunicationID(SchemedID schemedID) {
|
||||||
|
uriUniversalCommunicationId=schemedID;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* required (for senders, if payment is not debit): the BIC and IBAN
|
* required (for senders, if payment is not debit): the BIC and IBAN
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ public interface IZUGFeRDExportableTradeParty {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
|
||||||
|
/***
|
||||||
* gets the official representation
|
* gets the official representation
|
||||||
* @return the interface with the attributes of the legal organisation
|
* @return the interface with the attributes of the legal organisation
|
||||||
*/
|
*/
|
||||||
@@ -66,6 +67,23 @@ public interface IZUGFeRDExportableTradeParty {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* URIUniversalCommunication scheme (see EAS code list of the ZUGFeRD documentation)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
default String getUriUniversalCommunicationIDScheme() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The URIID of URIUniversalCommunicationID
|
||||||
|
* It is used by some countries, i.e. Luxembourg
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
default String getUriUniversalCommunicationID() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
default IZUGFeRDExportableContact getContact() {
|
default IZUGFeRDExportableContact getContact() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -157,14 +157,11 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
+ "</ram:FaxUniversalCommunication>";
|
+ "</ram:FaxUniversalCommunication>";
|
||||||
}
|
}
|
||||||
if (party.getContact().getEMail() != null) {
|
if (party.getContact().getEMail() != null) {
|
||||||
|
|
||||||
xml += "<ram:EmailURIUniversalCommunication><ram:URIID>"
|
xml += "<ram:EmailURIUniversalCommunication><ram:URIID>"
|
||||||
+ XMLTools.encodeXML(party.getContact().getEMail()) + "</ram:URIID>"
|
+ XMLTools.encodeXML(party.getContact().getEMail()) + "</ram:URIID>"
|
||||||
+ "</ram:EmailURIUniversalCommunication>";
|
+ "</ram:EmailURIUniversalCommunication>";
|
||||||
}
|
}
|
||||||
|
|
||||||
xml += "</ram:DefinedTradeContact>";
|
xml += "</ram:DefinedTradeContact>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
xml += "<ram:PostalTradeAddress>";
|
xml += "<ram:PostalTradeAddress>";
|
||||||
@@ -188,11 +185,17 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
|||||||
xml += "<ram:CityName>" + XMLTools.encodeXML(party.getLocation())
|
xml += "<ram:CityName>" + XMLTools.encodeXML(party.getLocation())
|
||||||
+ "</ram:CityName>";
|
+ "</ram:CityName>";
|
||||||
}
|
}
|
||||||
;
|
|
||||||
//country IS mandatory
|
//country IS mandatory
|
||||||
xml += "<ram:CountryID>" + XMLTools.encodeXML(party.getCountry())
|
xml += "<ram:CountryID>" + XMLTools.encodeXML(party.getCountry())
|
||||||
+ "</ram:CountryID>"
|
+ "</ram:CountryID>"
|
||||||
+ "</ram:PostalTradeAddress>";
|
+ "</ram:PostalTradeAddress>";
|
||||||
|
if (party.getUriUniversalCommunicationID() != null && party.getUriUniversalCommunicationIDScheme()!=null) {
|
||||||
|
xml += "<ram:URIUniversalCommunication>" +
|
||||||
|
"<ram:URIID schemeID=\"" + party.getUriUniversalCommunicationIDScheme() + "\">" +
|
||||||
|
XMLTools.encodeXML(party.getUriUniversalCommunicationID())
|
||||||
|
+ "</ram:URIID></ram:URIUniversalCommunication>";
|
||||||
|
}
|
||||||
|
|
||||||
if ((party.getVATID() != null) && (!isShipToTradeParty)) {
|
if ((party.getVATID() != null) && (!isShipToTradeParty)) {
|
||||||
xml += "<ram:SpecifiedTaxRegistration>"
|
xml += "<ram:SpecifiedTaxRegistration>"
|
||||||
|
|||||||
Reference in New Issue
Block a user