Merge branch 'issues/503-ubl' of github.com:ZUGFeRD/mustangproject into issues/503-ubl

This commit is contained in:
jstaerk
2024-11-25 19:42:35 +01:00
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);
}
});