corrected UBL behaviour (ignorance)

This commit is contained in:
jstaerk
2025-07-30 10:18:13 +02:00
parent 5555db58aa
commit d598ae94b0

View File

@@ -123,10 +123,12 @@ public class Item implements IZUGFeRDExportableItem {
itemMap.getAsString("Note") itemMap.getAsString("Note")
.ifPresent(this::addNote); .ifPresent(this::addNote);
if (itemMap.getNode("SpecifiedTradeProduct").isPresent()) { if (product==null) { // CII
product = new Product(itemMap.getNode("SpecifiedTradeProduct").get()); if (itemMap.getNode("SpecifiedTradeProduct").isPresent()) {
} else { product = new Product(itemMap.getNode("SpecifiedTradeProduct").get());
product = new Product(); } else {
product = new Product();
}
} }
itemMap.getAsNodeMap("SpecifiedLineTradeAgreement", "SpecifiedSupplyChainTradeAgreement").ifPresent(icnm -> { itemMap.getAsNodeMap("SpecifiedLineTradeAgreement", "SpecifiedSupplyChainTradeAgreement").ifPresent(icnm -> {
@@ -161,16 +163,6 @@ public class Item implements IZUGFeRDExportableItem {
} }
}); });
}); });
/*
String chargeIndicator = gpptpNodes.getAsNodeMap("AppliedTradeAllowanceCharge").flatMap(acChargeIndicatorNodes -> acChargeIndicatorNodes.getAsString("ChargeIndicator")).get();
if (chargeIndicator != null) {
BigDecimal actual = gpptpNodes.getAsNodeMap("AppliedTradeAllowanceCharge").flatMap(acChargeIndicatorNodes -> acChargeIndicatorNodes.getAsBigDecimal("ActualAmount")).get();
if (actual != null) {
}
}*/
icnm.getAllNodes("AdditionalReferencedDocument").map(ReferencedDocument::fromNode). icnm.getAllNodes("AdditionalReferencedDocument").map(ReferencedDocument::fromNode).
forEach(this::addReferencedDocument); forEach(this::addReferencedDocument);
}); });
@@ -250,7 +242,7 @@ public class Item implements IZUGFeRDExportableItem {
}); });
}); });
itemMap.getAllNodes("AllowanceCharge").map(NodeMap::new).forEach(stac -> { //UBL itemMap.getAllNodes("AllowanceCharge").map(NodeMap::new).forEach(stac -> { //CII
String isChargeString = stac.getAsString("ChargeIndicator").get(); String isChargeString = stac.getAsString("ChargeIndicator").get();
String percentString = stac.getAsStringOrNull("MultiplierFactorNumeric"); String percentString = stac.getAsStringOrNull("MultiplierFactorNumeric");