Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
2.24.x
=======
- #1134 Fix: Trade party universal communication id not imported when scheme is not "email address" (EM) but "electronic address" (0225).
- #1150 Remove [D].[M].[Y] after Rechnungsdatum in HTML visualization
- #996 Omit ExemptionReason written to line item level for profile EN16931, some validators raise a warning or even an error
- #1097 Invoice importer: LegalOrganization id not imported (wrong node name 'GlobalID' instead of 'ID' used)
Expand Down
25 changes: 15 additions & 10 deletions library/src/main/java/org/mustangproject/TradeParty.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ protected void parseFromUBL(NodeList nodes) {
}
if (party.item(partyIndex).getLocalName().equals("EndpointID")) {
Node currentNode = party.item(partyIndex);
if ((currentNode.getAttributes() != null &&
(currentNode.getAttributes().getNamedItem("schemeID") != null))
&& (party.item(partyIndex).getAttributes().getNamedItem("schemeID").getNodeValue().equals("EM"))
) {
setEmail(currentNode.getTextContent());
List<String> supportedSchemeIDs = Arrays.asList("EM", "0225");
if ((currentNode.getAttributes() != null
&& (currentNode.getAttributes().getNamedItem("schemeID") != null))
&& (supportedSchemeIDs.contains(currentNode.getAttributes().getNamedItem("schemeID").getNodeValue()))) {
setEmail(currentNode.getAttributes().getNamedItem("schemeID").getNodeValue(), currentNode.getTextContent());
}

}
Expand Down Expand Up @@ -425,14 +425,13 @@ public TradeParty(NodeList nodes) {
}
if (itemChilds.item(itemChildIndex).getLocalName().equals("URIUniversalCommunication")) {
NodeList URIchilds = itemChilds.item(itemChildIndex).getChildNodes();
List<String> supportedSchemeIDs = Arrays.asList("EM", "0225");
for (int URIChildIndex = 0; URIChildIndex < URIchilds.getLength(); URIChildIndex++) {
Node currentNode = URIchilds.item(URIChildIndex);
if ((currentNode.getLocalName() != null) && (currentNode.getLocalName().equals("URIID")
&&
(currentNode.getAttributes().getNamedItem("schemeID") != null))
&& (URIchilds.item(URIChildIndex).getAttributes().getNamedItem("schemeID").getNodeValue().equals("EM"))
) {
setEmail(currentNode.getTextContent());
&& (currentNode.getAttributes().getNamedItem("schemeID") != null))
&& (supportedSchemeIDs.contains(currentNode.getAttributes().getNamedItem("schemeID").getNodeValue()))) {
setEmail(currentNode.getAttributes().getNamedItem("schemeID").getNodeValue(), currentNode.getTextContent());
}
}
}
Expand Down Expand Up @@ -520,6 +519,12 @@ public TradeParty setEmail(String eMail) {
return this;
}

public TradeParty setEmail(String schemeID, String eMail) {
SchemedID theSchemedID = new SchemedID(schemeID, eMail);
addUriUniversalCommunicationID(theSchemedID);
return this;
}


/**
* if it's a customer, this can e.g. be the customer ID
Expand Down
Loading