corrected writing
This commit is contained in:
@@ -72,8 +72,6 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
//we need: name description unitcode
|
||||
//and we additionally have vat%
|
||||
|
||||
// Bharti's homework 20241126:Streams https://www.youtube.com/watch?v=Lf01cBzmuXw
|
||||
// and Lambdas https://www.youtube.com/watch?v=HCyx31NW8xg
|
||||
setProduct(new Product(itemMap.getNode("Item").get()));
|
||||
icnm.getAsString("Name").ifPresent(product::setName);
|
||||
icnm.getAsString("Description").ifPresent(product::setDescription);
|
||||
@@ -86,17 +84,6 @@ public class Item implements IZUGFeRDExportableItem {
|
||||
BuyersItemIdentification.getAsString("ID").ifPresent(product::setBuyerAssignedID);
|
||||
});
|
||||
|
||||
// String name = icnm.getAsStringOrNull("Name");
|
||||
// String val = icnm.getAsStringOrNull("Value");
|
||||
// if (name != null && val != null) {
|
||||
// if (attributes == null) {
|
||||
// attributes = new HashMap<>();
|
||||
// }
|
||||
// product.attributes.put(name, val);
|
||||
// }
|
||||
//icnm.getNode("AdditionalItemProperty").flatMap(n ->n.getAttributes()).ifPresent(product::setAttributes);
|
||||
|
||||
|
||||
icnm.getAsNodeMap("ClassifiedTaxCategory").flatMap(m -> m.getAsBigDecimal("Percent"))
|
||||
.ifPresent(product::setVATPercent);
|
||||
});
|
||||
|
||||
@@ -547,7 +547,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
+ "</ram:ApplicableTradeTax>";
|
||||
// item charges/allowances
|
||||
if (!itemTotalAllowanceChargeStr.isEmpty()) {
|
||||
xml += "<ram:SpecifiedTradeAllowanceCharge>"+ itemTotalAllowanceChargeStr +"</ram:SpecifiedTradeAllowanceCharge>";
|
||||
xml += itemTotalAllowanceChargeStr ;
|
||||
}
|
||||
|
||||
if ((currentItem.getDetailedDeliveryPeriodFrom() != null) || (currentItem.getDetailedDeliveryPeriodTo() != null)) {
|
||||
|
||||
@@ -383,29 +383,7 @@ public class ZUGFeRDInvoiceImporter {
|
||||
});
|
||||
});
|
||||
String street, name, additionalStreet, city, postal, countrySubentity, line, country = null;
|
||||
/*
|
||||
String idx = extractString("//*[local-name()=\"DeliveryLocation\"]/*[local-name() = \"ID\"]");
|
||||
street = extractString("//*[local-name()=\"DeliveryLocation\"]/*[local-name()=\"Address\"]/*[local-name()=\"StreetName\"]");
|
||||
additionalStreet = extractString("//*[local-name()=\"DeliveryLocation\"]/*[local-name() = \"Address\"]/*[local-name() = \"AdditionalStreetName\"]");
|
||||
city = extractString("//*[local-name()=\"DeliveryLocation\"]/*[local-name() = \"Address\"]/*[local-name() = \"CityName\"]");
|
||||
postal = extractString("//*[local-name()=\"DeliveryLocation\"]/*[local-name() = \"Address\"]/*[local-name() = \"PostalZone\"]");
|
||||
countrySubentity = extractString("//*[local-name()=\"DeliveryLocation\"]/*[local-name() = \"Address\"]/*[local-name() = \"CountrySubentity\"]");
|
||||
line = extractString("//*[local-name()=\"DeliveryLocation\"]/*[local-name() = \"Address\"]//*[local-name() = \"AddressLine\"]/*[local-name() = \"Line\"]");
|
||||
country = extractString("//*[local-name()=\"DeliveryLocation\"]/*[local-name() = \"Address\"]//*[local-name() = \"Country\"]/*[local-name() = \"IdentificationCode\"]");
|
||||
name = extractString("//*[local-name()=\"DeliveryLocation\"]/*[local-name() = \"DeliveryParty\"]//*[local-name() = \"PartyName\"]/*[local-name() = \"Name\"]");
|
||||
*/
|
||||
zpp.setDeliveryAddress(delivery);
|
||||
/*
|
||||
zpp.setDeliveryAddress(new TradeParty()
|
||||
.setStreet(street)
|
||||
.setAdditionalAddress(additionalStreet)
|
||||
.setLocation(city)
|
||||
.setZIP(postal)
|
||||
.setAdditionalAddressExtension(line)
|
||||
.setCountry(country)
|
||||
.setName(name)
|
||||
);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
@@ -420,31 +398,8 @@ public class ZUGFeRDInvoiceImporter {
|
||||
XPathExpression shipPayee = xpath.compile("//*[local-name()=\"PayeeParty\"]/*");
|
||||
NodeList ublPayeeNodes = (NodeList) shipPayee.evaluate(getDocument(), XPathConstants.NODESET);
|
||||
|
||||
// if(ublPayeeNodes != null) {
|
||||
// TradeParty payee = new TradeParty();
|
||||
// NodeMap nodeMap = new NodeMap(ublPayeeNodes).getAsNodeMap("PayeeParty").get();
|
||||
// nodeMap.getNode("ID").ifPresent(s -> {
|
||||
// SchemedID sID = new SchemedID().setScheme(s.getAttributes().getNamedItem("schemeID").getTextContent()).setId(s.getTextContent());
|
||||
// payee.addGlobalID(sID);
|
||||
// });
|
||||
// }
|
||||
//NodeList UBLpayeeNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
|
||||
zpp.setPayee(new TradeParty(ublPayeeNodes));
|
||||
// TradeParty payee =new TradeParty();
|
||||
// NodeMap payeeID = new NodeMap(UBLpayeeNodes).getAsNodeMap("PartyIdentification").get();
|
||||
// if (payeeID !=null) {
|
||||
// payeeID.getAsString("Name").ifPresent(t->payee.setName(t));
|
||||
// }
|
||||
// if (payeeNodes != null) {
|
||||
// TradeParty payee =new TradeParty();
|
||||
// NodeMap nodeMap = new NodeMap(payeeNodes).getAsNodeMap("PartyIdentification").get();
|
||||
// if (nodeMap != null) {
|
||||
// nodeMap.getNode("ID").ifPresent(s -> {
|
||||
// SchemedID sID = new SchemedID().setScheme(s.getAttributes().getNamedItem("schemeID").getTextContent()).setId(s.getTextContent());
|
||||
// payee.addGlobalID(sID);
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
xpr = xpath.compile("//*[local-name()=\"ExchangedDocument\"]|//*[local-name()=\"HeaderExchangedDocument\"]");
|
||||
@@ -834,9 +789,6 @@ public class ZUGFeRDInvoiceImporter {
|
||||
}
|
||||
}
|
||||
}
|
||||
// if ((paymentMeansChilds.item(paymentTermChildIndex).getLocalName() != null) && (paymentTermChilds.item(paymentTermChildIndex).getLocalName().equals("DirectDebitMandateID"))) {
|
||||
// directDebitMandateID = paymentTermChilds.item(paymentTermChildIndex).getTextContent();
|
||||
// }
|
||||
if ((paymentMeansChilds.item(meansChildIndex).getLocalName() != null)
|
||||
&& (paymentMeansChilds.item(meansChildIndex).getLocalName().equals("PaymentMandate"))) {
|
||||
NodeList paymentMandateChilds = paymentMeansChilds.item(meansChildIndex).getChildNodes();
|
||||
|
||||
Reference in New Issue
Block a user