From 5bad27ea62c862b2542ca7a3032aabd4321cb075 Mon Sep 17 00:00:00 2001
From: asdf00000 <56080856+asdf00000@users.noreply.github.com>
Date: Wed, 17 Apr 2024 14:25:13 +0200
Subject: [PATCH] Update ZUGFeRD2PullProvider.java
removing GrossPriceProductTradePrice when there is no
no allowance per line to fix validation error
---
.../ZUGFeRD/ZUGFeRD2PullProvider.java | 30 +++++++++++--------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java
index bd133558..fc5182e5 100644
--- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java
+++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRD2PullProvider.java
@@ -404,19 +404,23 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
+ "" + XMLTools.encodeXML(currentItem.getBuyerOrderReferencedDocumentLineID()) + ""
+ "";
}
- xml += ""
- + "" + priceFormat(lc.getPriceGross())
- + "" //currencyID=\"EUR\"
- + "" + quantityFormat(currentItem.getBasisQuantity()) + ""
- + allowanceChargeStr
- // + " "
- // + " false"
- // + " 0.6667"
- // + " Rabatt"
- // + " "
- + ""
- + ""
+
+ if (!allowanceChargeStr.isBlank()) {
+ xml += ""
+ + "" + priceFormat(lc.getPriceGross())
+ + "" //currencyID=\"EUR\"
+ + "" + quantityFormat(currentItem.getBasisQuantity()) + ""
+ + allowanceChargeStr
+ // + " "
+ // + " false"
+ // + " 0.6667"
+ // + " Rabatt"
+ // + " "
+ + "";
+ }
+
+ xml += ""
+ "" + priceFormat(lc.getPrice())
+ "" // currencyID=\"EUR\"
+ "