diff --git a/History.md b/History.md
index 4e083294..701106d8 100644
--- a/History.md
+++ b/History.md
@@ -1,15 +1,25 @@
-- 639
-- 633
--626,
--622,
--356
-allow to add includedNotes with type
-- - 645
-- 631 multiple invoice referenced documents
-- 629
-- 630 #296 #565
-- 657
-- 658
+
+2.16.0
+=======
+2025-01-10
+- #657 allow allowancechargereasoncodes on document level
+- allow to add includedNotes with type
+- #356 print version of xml report
+- #645 Fix visualization of validation logs
+- #639 Fix invoice calculation if rounding amount is present
+- #633 Bump ch.qos.logback:logback-core from 1.2.13 to 1.5.13
+- #626 Fix minor java issues
+- #622 Fix FOP config
+- #631 multiple invoice referenced documents
+- #629 Visualizing xml
+- #630 Fix issue #296 (Validation-Error: Ungültiger Content wurde beginnend mit Element 'ram:DueDateDateTime' ) (duplicate of #565)
+- #658 prevent nullpointerexception
+- #648 Fix log visualization
+- #651 ZUGFeRDInvoiceImporter: Item-Allowances not imported
+- #652 Discount VAT is not subtracted from duepayable
+- #620 Fix logback config
+- #653 ZF2EdgeTest: methods 'getPaymentMeansCode()' & 'getPaymentMeansInformation()' does not override super methods
+- #654 remove wrong test methods
2.15.2
=======
diff --git a/Mustang-CLI/pom.xml b/Mustang-CLI/pom.xml
index 5780bd71..9b5e3bc9 100644
--- a/Mustang-CLI/pom.xml
+++ b/Mustang-CLI/pom.xml
@@ -37,15 +37,10 @@
-
- ch.qos.logback
- logback-classic
- 1.2.13
-
ch.qos.logback
logback-core
- 1.5.13
+ 1.5.16
diff --git a/Mustang-CLI/src/main/resources/logback.xml b/Mustang-CLI/src/main/resources/logback.xml
index d8c56d7e..9efdfd4c 100644
--- a/Mustang-CLI/src/main/resources/logback.xml
+++ b/Mustang-CLI/src/main/resources/logback.xml
@@ -1,38 +1,36 @@
-
-
-
- System.err
-
- %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-
-
-
-
-
-
-
-
-
- log/ZUV-%d{yyyy-MM}.log
-
-
- 60
-
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+ System.err
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+ log/ZUV-%d{yyyy-MM}.log
+
+ 60
+
+
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/library/src/main/java/org/mustangproject/Item.java b/library/src/main/java/org/mustangproject/Item.java
index 4641a0e3..8fefa87f 100644
--- a/library/src/main/java/org/mustangproject/Item.java
+++ b/library/src/main/java/org/mustangproject/Item.java
@@ -172,6 +172,32 @@ public class Item implements IZUGFeRDExportableItem {
icnm.getAsNodeMap("ApplicableTradeTax")
.flatMap(cnm -> cnm.getAsBigDecimal("RateApplicablePercent", "ApplicablePercent"))
.ifPresent(product::setVATPercent);
+ icnm.getAsNodeMap("SpecifiedTradeAllowanceCharge").ifPresent(stac -> {
+ stac.getAsNodeMap("ChargeIndicator").ifPresent(ci -> {
+ String isChargeString=ci.getAsString("Indicator").get();
+ String percentString=stac.getAsStringOrNull("CalculationPercent");
+ String amountString=stac.getAsStringOrNull("ActualAmount");
+ String reason=stac.getAsStringOrNull("Reason");
+ Charge izac= new Charge();
+ if (isChargeString.equalsIgnoreCase("false")) {
+ izac = new Allowance();
+ } else {
+ izac = new Charge();
+ }
+ if (amountString!=null) {
+ izac.setTotalAmount(new BigDecimal(amountString));
+ }
+ izac.setPercent(new BigDecimal(percentString));
+ izac.setReason(reason);
+
+ if (isChargeString.equalsIgnoreCase("false")) {
+ addAllowance(izac);
+ } else {
+ addCharge(izac);
+ }
+ });
+
+ });
if (recalcPrice && !BigDecimal.ZERO.equals(quantity)) {
icnm.getAsNodeMap("SpecifiedTradeSettlementLineMonetarySummation")
diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/LineCalculator.java b/library/src/main/java/org/mustangproject/ZUGFeRD/LineCalculator.java
index e319ec73..d17ccfec 100644
--- a/library/src/main/java/org/mustangproject/ZUGFeRD/LineCalculator.java
+++ b/library/src/main/java/org/mustangproject/ZUGFeRD/LineCalculator.java
@@ -55,7 +55,7 @@ public class LineCalculator {
BigDecimal basisQuantity = currentItem.getBasisQuantity().compareTo(BigDecimal.ZERO) == 0
? BigDecimal.ONE.setScale(4)
: currentItem.getBasisQuantity();
- itemTotalNetAmount = quantity.multiply(getPrice()).divide(basisQuantity, 18, RoundingMode.HALF_UP)
+ itemTotalNetAmount = quantity.multiply(price).divide(basisQuantity, 18, RoundingMode.HALF_UP)
.subtract(allowanceItemTotal).setScale(2, RoundingMode.HALF_UP);
itemTotalVATAmount = itemTotalNetAmount.multiply(multiplicator);
}
diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java
index 0417990d..de66b35d 100644
--- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java
+++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java
@@ -897,7 +897,7 @@ public class ZUGFeRDInvoiceImporter {
// be read,
// so the invoice remains arithmetically correct
// -> parse document level charges+allowances
- xpr = xpath.compile("//*[local-name()=\"SpecifiedTradeAllowanceCharge\"]|//*[local-name()=\"AllowanceCharge\"]");//CII and UBL
+ xpr = xpath.compile("//*[local-name()=\"ApplicableHeaderTradeSettlement\"]/*[local-name()=\"SpecifiedTradeAllowanceCharge\"]|/*[local-name()=\"AllowanceCharge\"]");//CII and UBL
NodeList chargeNodes = (NodeList) xpr.evaluate(getDocument(), XPathConstants.NODESET);
for (int i = 0; i < chargeNodes.getLength(); i++) {
NodeList chargeNodeChilds = chargeNodes.item(i).getChildNodes();
diff --git a/library/src/main/resources/logback.xml b/library/src/main/resources/logback.xml
index 011cab8b..7c5e39d4 100644
--- a/library/src/main/resources/logback.xml
+++ b/library/src/main/resources/logback.xml
@@ -1,33 +1,37 @@
-
-
-
- System.err
-
- %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-
-
-
-
-
-
-
-
- log/ZUV-%d{yyyy-MM}.log
-
-
- 60
-
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-
-
-
-
-
-
-
-
-
-
-
+
+
+ System.err
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+ log/ZUV-%d{yyyy-MM}.log
+
+ 60
+
+
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/library/src/main/resources/stylesheets/result-pdf.xsl b/library/src/main/resources/stylesheets/result-pdf.xsl
index 9ffe8e1e..0dfa7c95 100644
--- a/library/src/main/resources/stylesheets/result-pdf.xsl
+++ b/library/src/main/resources/stylesheets/result-pdf.xsl
@@ -9,11 +9,11 @@
- Es wird empfohlen, das Dokument anzunehmen und weiterzuverarbeiten.
+ Es wird empfohlen, das Dokument anzunehmen und es weiterzuverarbeiten.
Es wird empfohlen, das Dokument zurückzuweisen.
@@ -71,47 +71,59 @@
+ select="'Angaben zum geprüften Dokument'"/>
+ select="'black'"/>
-
-
-
-
-
-
-
- Referenz:
-
-
-
-
-
-
-
-
-
- Zeitpunkt der Prüfung:
-
-
-
-
-
-
-
-
-
- Erkannter Dokumenttyp:
-
-
-
+
+
+
+
+
+
+ Referenz:
+
+
+
+
+
+
+
+
+
+ Zeitpunkt der Prüfung:
+
+
+
+
+
+
+
+
+
+ Erkannter Dokumenttyp:
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -125,35 +137,44 @@
-
+
+ font-weight="bold"
+ border-style="solid">
- Type
+ Type
- Code
+ Code
- Schwere
+ Schwere
- Text
+ Text
-
+
-
-
+
+
-
+
- Es gibt weder Hinweise noch Fehler.
+ Es gibt keine Hinweise, Warnungen oder Fehler.
@@ -164,62 +185,113 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- red
- Fehler
-
-
- Hinweis
-
-
+
+
+
+
+ red
+
+
+ orange
+
+
+ black
+
+
+
+
+
+
+ Fehler
+
+
+ Warnung
+
+
+ Hinweis
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- red
-
-
+
+
-
-
-
-
- red
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ select="'black'"/>
@@ -234,10 +306,22 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java
index 03c495c8..56a64b16 100644
--- a/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java
+++ b/library/src/test/java/org/mustangproject/ZUGFeRD/ZF2PushTest.java
@@ -478,8 +478,8 @@ public class ZF2PushTest extends TestCase {
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)))
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)))
.addItem(new Item(new Product("Testprodukt", "", "C62", new BigDecimal(19)), amount, new BigDecimal(1.0)))
- .addCharge(new Charge(new BigDecimal(0.5)).setTaxPercent(new BigDecimal(19)))
- .addAllowance(new Allowance(new BigDecimal(0.2)).setTaxPercent(new BigDecimal(19)))
+ .addCharge(new Charge(new BigDecimal(0.5)).setTaxPercent(new BigDecimal(19)).setReasonCode("ABK"))
+ .addAllowance(new Allowance(new BigDecimal(0.2)).setTaxPercent(new BigDecimal(19)).setReasonCode("ABK"))
);
String theXML = new String(ze.getProvider().getXML());
assertTrue(theXML.contains("
-
-
- System.err
-
- %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-
-
-
-
-
-
-
- log/ZUV-%d{yyyy-MM}.log
-
-
- 60
-
-
-
- %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
-
-
-
-
-
-
-
-
-
+
+
+ System.err
+
+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+ log/ZUV-%d{yyyy-MM}.log
+
+ 60
+
+
+ %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
+
+
+
+
+
+
+