Item: add BillingSpecifiedPeriod

parses SpecifiedLineTradeSettlement->BillingSpecifiedPeriod to
detailedDeliveryPeriod
also fix parser for multiple ApplicableProductCharacteristics
This commit is contained in:
ean
2025-01-16 13:08:16 +01:00
parent 4a410bcd14
commit 1fb4b94718
3 changed files with 19 additions and 2 deletions

View File

@@ -206,6 +206,12 @@ public class Item implements IZUGFeRDExportableItem {
}
icnm.getAllNodes("AdditionalReferencedDocument").map(ReferencedDocument::fromNode).forEach(this::addAdditionalReference);
icnm.getAsNodeMap("BillingSpecifiedPeriod").ifPresent(periodNode -> {
Date start = periodNode.getAsNodeMap("StartDateTime").flatMap(dateTimeNode -> dateTimeNode.getNode("DateTimeString")).map(dts -> XMLTools.tryDate(dts)).orElse(null);
Date end = periodNode.getAsNodeMap("EndDateTime").flatMap(dateTimeNode -> dateTimeNode.getNode("DateTimeString")).map(dts -> XMLTools.tryDate(dts)).orElse(null);
setDetailedDeliveryPeriod(start, end);
});
});
itemMap.getAsNodeMap("AssociatedDocumentLineDocument").ifPresent(adld -> {

View File

@@ -69,7 +69,7 @@ public class Product implements IZUGFeRDExportableProduct {
nodeMap.getAsString("Description").ifPresent(this::setDescription);
nodeMap.getAsNodeMap("ApplicableProductCharacteristic").ifPresent(apcNodes -> {
nodeMap.getAllNodes("ApplicableProductCharacteristic").map(NodeMap::new).forEach(apcNodes -> { // ApplicableProductCharacteristic is 0 .. unbounded
String key = apcNodes.getAsStringOrNull("Description");
String value = apcNodes.getAsStringOrNull("Value");
if (key != null && value != null) {
@@ -80,7 +80,6 @@ public class Product implements IZUGFeRDExportableProduct {
}
});
//UBL
nodeMap.getAsNodeMap("AdditionalItemProperty").ifPresent(aipNodes -> {
String name = aipNodes.getAsStringOrNull("Name");