no message

This commit is contained in:
jstaerk
2024-11-26 09:46:34 +01:00
parent b6ac2dc29d
commit 30022a061a

View File

@@ -64,9 +64,17 @@ public class Item implements IZUGFeRDExportableItem {
// ubl // ubl
//we need: name description unitcode //we need: name description unitcode
//and we additionally have vat% //and we additionally have vat%
// Bhartis homework 20241126:Streams https://www.youtube.com/watch?v=Lf01cBzmuXw and Lamdas https://www.youtube.com/watch?v=HCyx31NW8xg
setProduct(new Product()); setProduct(new Product());
icnm.getAsString("Name").ifPresent(product::setName); icnm.getAsString("Name").ifPresent(product::setName);
icnm.getAsString("Description").ifPresent(product::setDescription); icnm.getAsString("Description").ifPresent(product::setDescription);
icnm.getAsNodeMap("SellersItemIdentification").ifPresent(SellersItemIdentification -> {
SellersItemIdentification.getAsString("ID").ifPresent(product::setSellerAssignedID);
});
// icnm.getAsString("BuyerAssignedID").ifPresent(this::setBuyerAssignedID);
icnm.getAsNodeMap("ClassifiedTaxCategory").flatMap(m -> m.getAsBigDecimal("Percent")) icnm.getAsNodeMap("ClassifiedTaxCategory").flatMap(m -> m.getAsBigDecimal("Percent"))
.ifPresent(product::setVATPercent); .ifPresent(product::setVATPercent);
}); });
@@ -98,7 +106,8 @@ public class Item implements IZUGFeRDExportableItem {
.forEach(this::addReferencedDocument); .forEach(this::addReferencedDocument);
}); });
itemMap.getNode("SpecifiedTradeProduct").map(Product::new).ifPresent(this::setProduct); itemMap.getNode("SpecifiedTradeProduct").map(Product::new).ifPresent(this::setProduct);//CII
itemMap.getNode("SpecifiedTradeProduct").map(Product::new).ifPresent(this::setProduct);//UBL
// RequestedQuantity is for Order-X, BilledQuantity for FX and ZF // RequestedQuantity is for Order-X, BilledQuantity for FX and ZF
itemMap.getAsNodeMap("SpecifiedLineTradeDelivery", "SpecifiedSupplyChainTradeDelivery") itemMap.getAsNodeMap("SpecifiedLineTradeDelivery", "SpecifiedSupplyChainTradeDelivery")