Merge pull request #686 from InnuceEAN/parse_item_BillingSpecifiedPeriod

Item: add BillingSpecifiedPeriod
This commit is contained in:
Jochen Staerk
2025-02-11 13:18:23 +01:00
committed by GitHub
3 changed files with 40 additions and 23 deletions

View File

@@ -191,10 +191,10 @@ public class Item implements IZUGFeRDExportableItem {
izac.setTotalAmount(new BigDecimal(amountString));
}
if(percentString!=null) {
izac.setPercent(new BigDecimal(percentString));
izac.setPercent(new BigDecimal(percentString));
}
if(reason!=null) {
izac.setReason(reason);
izac.setReason(reason);
}
if (isChargeString.equalsIgnoreCase("false")) {
@@ -213,6 +213,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");