-
-
Notifications
You must be signed in to change notification settings - Fork 208
Closed
Description
Issue: TradeParty Name Should Be Optional for ShipToTradeParty
Description
I am generating an XRechnung invoice using ZUGFeRD2PullProvider. The delivery information includes an optional field, Deliver to party name (BT-70), which, according to the specification, is not mandatory. However, the current implementation does not handle null values for this field, leading to potential issues.
The issue arises because the same function is used for creating a TradeParty, and this function does not allow the name field to be optional.
ZUGFeRD2PullProvider.java - Lines 635-649
if (this.trans.getDeliveryAddress() != null) {
xml += "<ram:ShipToTradeParty>" +
getTradePartyAsXML(this.trans.getDeliveryAddress(), false, true) +
"</ram:ShipToTradeParty>";
}ZUGFeRD2PullProvider.java - Line 142
xml += "<ram:Name>" + XMLTools.encodeXML(party.getName()) + "</ram:Name>";Suggested fix:
if (party.getName() != null && !party.getName().isEmpty()) {
xml += "<ram:Name>" + XMLTools.encodeXML(party.getName()) + "</ram:Name>";
}Thank you in advance!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels