Check if street in the address of the recipient is null

Fixes #222
This commit is contained in:
Daniel Murygin
2021-02-08 10:12:33 +01:00
parent f7a4635285
commit e90d1e12fd

View File

@@ -156,9 +156,11 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
} }
xml += " <ram:PostalTradeAddress>\n" xml += " <ram:PostalTradeAddress>\n"
+ " <ram:PostcodeCode>" + XMLTools.encodeXML(party.getZIP()) + " <ram:PostcodeCode>" + XMLTools.encodeXML(party.getZIP())
+ "</ram:PostcodeCode>\n" + "</ram:PostcodeCode>\n";
+ " <ram:LineOne>" + XMLTools.encodeXML(party.getStreet()) if (party.getStreet() != null) {
+ "</ram:LineOne>\n"; xml += " <ram:LineOne>" + XMLTools.encodeXML(party.getStreet())
+ "</ram:LineOne>\n";
}
if (party.getAdditionalAddress() != null) { if (party.getAdditionalAddress() != null) {
xml += " <ram:LineTwo>" + XMLTools.encodeXML(party.getAdditionalAddress()) xml += " <ram:LineTwo>" + XMLTools.encodeXML(party.getAdditionalAddress())
+ "</ram:LineTwo>\n"; + "</ram:LineTwo>\n";