From 2a9b9221af5402c4ebfb5d76e228ae43a23693f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jochen=20St=C3=A4rk?= Date: Mon, 6 Apr 2026 15:40:41 +0200 Subject: [PATCH] additional output in arithmetric exception --- History.md | 1 + .../org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/History.md b/History.md index da96f4a9..822000aa 100644 --- a/History.md +++ b/History.md @@ -2,6 +2,7 @@ #1044 #1075 #993 +#1072 -reduce exceptions in metrics 2.22.0 diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java index 86230fb4..bc1b03ac 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/ZUGFeRDInvoiceImporter.java @@ -1374,6 +1374,9 @@ public class ZUGFeRDInvoiceImporter { + Stream.of(tc.trans.getZFItems()) .map(item -> item.getCalculation().getItemTotalNetAmount().toPlainString()) .collect(Collectors.joining(" + ")); + if (tc.trans.getRoundingAmount()!=null) { + moreDetails += " and rounding amount "+tc.trans.getRoundingAmount().toPlainString(); + } } catch (Exception ignored) { } throw new ArithmeticException("Payable total in XML is " + payableTotalFromXml + ", but calculated total is " + calculatedPayableTotal + moreDetails);