UBL updates : delivery stuff
This commit is contained in:
@@ -65,6 +65,7 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void parseFromUBL(NodeList nodes) {
|
protected void parseFromUBL(NodeList nodes) {
|
||||||
if (nodes.getLength() > 0) {
|
if (nodes.getLength() > 0) {
|
||||||
|
|
||||||
@@ -93,42 +94,6 @@ public class TradeParty implements IZUGFeRDExportableTradeParty {
|
|||||||
addGlobalID(sID);
|
addGlobalID(sID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (deliveryLocation.item(deliveryLocationIndex).getLocalName().equals("Address")) {
|
|
||||||
NodeList address = currentNode.getChildNodes();
|
|
||||||
for (int addressChildIndex = 0; addressChildIndex < address.getLength(); addressChildIndex++) {
|
|
||||||
if (address.item(addressChildIndex).getLocalName() != null) {
|
|
||||||
if (address.item(addressChildIndex).getLocalName().equals("StreetName")) {
|
|
||||||
setStreet(address.item(addressChildIndex).getTextContent());
|
|
||||||
}
|
|
||||||
if (address.item(addressChildIndex).getLocalName().equals("AdditionalStreetName")) {
|
|
||||||
setAdditionalAddress(address.item(addressChildIndex).getTextContent());
|
|
||||||
}
|
|
||||||
if (address.item(addressChildIndex).getLocalName().equals("CityName")) {
|
|
||||||
setLocation(address.item(addressChildIndex).getTextContent());
|
|
||||||
}
|
|
||||||
if (address.item(addressChildIndex).getLocalName().equals("PostalZone")) {
|
|
||||||
setZIP(address.item(addressChildIndex).getTextContent());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (currentNode.getLocalName().equals("DeliveryParty")) {
|
|
||||||
NodeList deliveryParty = currentNode.getChildNodes();
|
|
||||||
for (int deliveryPartyChildIndex = 0; deliveryPartyChildIndex < deliveryParty.getLength(); deliveryPartyChildIndex++) {
|
|
||||||
if (deliveryParty.item(deliveryPartyChildIndex).getLocalName() != null) {
|
|
||||||
if (deliveryParty.item(deliveryPartyChildIndex).getLocalName().equals("PartyName")) {
|
|
||||||
NodeList partyName = deliveryParty.item(deliveryPartyChildIndex).getChildNodes();
|
|
||||||
for (int partyNameIndex = 0; partyNameIndex < partyName.getLength(); partyNameIndex++) {
|
|
||||||
if (partyName.item(partyNameIndex).getLocalName() != null) {
|
|
||||||
setName(partyName.item(partyNameIndex).getTextContent());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -305,16 +305,23 @@ public class ZUGFeRDInvoiceImporter {
|
|||||||
shipEx = xpath.compile("//*[local-name()=\"DeliveryLocation\"]");
|
shipEx = xpath.compile("//*[local-name()=\"DeliveryLocation\"]");
|
||||||
deliveryNodes = (NodeList) shipEx.evaluate(getDocument(), XPathConstants.NODESET);
|
deliveryNodes = (NodeList) shipEx.evaluate(getDocument(), XPathConstants.NODESET);
|
||||||
if (deliveryNodes!=null) {
|
if (deliveryNodes!=null) {
|
||||||
String street = "";
|
String street, name, additionalStreet, city, postal, countrySubentity, line, country = null;
|
||||||
if (deliveryNodes != null) {
|
street = extractString("//*[local-name() = \"Address\"]/*[local-name() = \"StreetName\"]");
|
||||||
|
additionalStreet = extractString("//*[local-name() = \"Address\"]/*[local-name() = \"AdditionalStreetName\"]");
|
||||||
|
city = extractString("//*[local-name() = \"Address\"]/*[local-name() = \"CityName\"]");
|
||||||
|
postal = extractString("//*[local-name() = \"Address\"]/*[local-name() = \"PostalZone\"]");
|
||||||
|
countrySubentity = extractString("//*[local-name() = \"Address\"]/*[local-name() = \"CountrySubentity\"]");
|
||||||
|
line = extractString("//*[local-name() = \"Address\"]//*[local-name() = \"AddressLine\"]/*[local-name() = \"Line\"]");
|
||||||
|
country = extractString("//*[local-name() = \"Address\"]//*[local-name() = \"Country\"]/*[local-name() = \"IdentificationCode\"]");
|
||||||
|
name = extractString("//*[local-name() = \"DeliveryParty\"]//*[local-name() = \"PartyName\"]/*[local-name() = \"Name\"]");
|
||||||
|
|
||||||
|
zpp.setDeliveryAddress(new TradeParty(deliveryNodes).setStreet(street).setAdditionalAddress(additionalStreet).setLocation(city).setZIP(postal).setAdditionalAddressExtension(line).setCountry(country).setName(name));
|
||||||
|
|
||||||
|
|
||||||
//street=....
|
|
||||||
}
|
|
||||||
name=ectractString("//DeliveryParty/name");
|
|
||||||
zpp.setDeliveryAddress(new TradeParty(name, street...));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
xpr = xpath.compile("//*[local-name()=\"BuyerTradeParty\"]|//*[local-name()=\"AccountingCustomerParty\"]/*");
|
xpr = xpath.compile("//*[local-name()=\"BuyerTradeParty\"]|//*[local-name()=\"AccountingCustomerParty\"]/*");
|
||||||
NodeList BuyerNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
NodeList BuyerNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user