UBL updates : adding description to item for ubl

This commit is contained in:
Bharti
2024-11-25 18:18:49 +01:00
parent ffe01537f6
commit f703e59842
2 changed files with 5 additions and 4 deletions

View File

@@ -66,6 +66,7 @@ public class Item implements IZUGFeRDExportableItem {
//and we additionally have vat%
setProduct(new Product());
icnm.getAsString("Name").ifPresent(product::setName);
icnm.getAsString("Description").ifPresent(product::setDescription);
icnm.getAsNodeMap("ClassifiedTaxCategory").flatMap(m -> m.getAsBigDecimal("Percent"))
.ifPresent(product::setVATPercent);
});

View File

@@ -82,13 +82,13 @@ public class Product implements IZUGFeRDExportableProduct {
//UBL
nodeMap.getAsNodeMap("AdditionalItemProperty").ifPresent(aipNodes -> {
String key = aipNodes.getAsStringOrNull("Name");
String value = aipNodes.getAsStringOrNull("Value");
if (key != null && value != null) {
String name = aipNodes.getAsStringOrNull("Name");
String val = aipNodes.getAsStringOrNull("Value");
if (name != null && val != null) {
if (attributes == null) {
attributes = new HashMap<>();
}
attributes.put(key, value);
attributes.put(name, val);
}
});