ITADN

Invalid `CalculatedInvoice#getTaxBasis` on imported CII file

#1047OpenJueverhard 创建于 2026-02-20
J
Jueverhardcommented
Hello, I've noticed something odd lately, I don't know whether it's a regression or if it was there since a long time, but when you import a CII file using the `ZUGFeRDInvoiceImporter`, the resulting `CalculatedInvoice` exposes a wrong tax basis via its getter (while it is correctly assembled using a `TranslationCalculator` based on the said invoice). Reproducible with this [file](https://github.com/user-attachments/files/25444917/Issue.with.tax.basis.xml), imported with the following code : ```java ZUGFeRDInvoiceImporter facturXImporter = new ZUGFeRDInvoiceImporter(); facturXImporter.doIgnoreCalculationErrors(); facturXImporter.setRawXML(Files.readAllBytes(filePath)); Invoice invoice = facturXImporter.extractInto(new CalculatedInvoice()); System.out.println(invoice.getTaxBasis()); // <-- prints "81.06", which corresponds to the last LineItem in the XML System.out.println(new TransactionCalculator(invoice).getTaxBasis()); // <-- prints "99.98", which is the actual invoice tax basis ``` This was reported using Java 17 and library release `2.21.0` Regards,
1 条评论