Revert previous change.

Instead, calculate the total amounts on amounts with scale 2 to avoid errors in validation.
This commit is contained in:
Sebastian Sieber
2020-12-08 15:49:48 +01:00
parent d97007d60f
commit 157ea9f554
2 changed files with 19 additions and 25 deletions

View File

@@ -613,10 +613,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
// //
// currencyID=\"EUR\"
+ " <ram:TaxTotalAmount currencyID=\"" + trans.getCurrency() + "\">"
+ currencyFormat(VATPercentAmountMap.values().stream()
.map(VATAmount::getCalculated)
.map(p -> p.setScale(2, RoundingMode.HALF_UP))
.reduce(BigDecimal.ZERO, BigDecimal::add)) + "</ram:TaxTotalAmount>\n"
+ currencyFormat(calc.getGrandTotal().subtract(calc.getTaxBasis()))+ "</ram:TaxTotalAmount>\n"
+ " <ram:GrandTotalAmount>" + currencyFormat(calc.getGrandTotal()) + "</ram:GrandTotalAmount>\n" //$NON-NLS-2$
// //
// currencyID=\"EUR\"