BigDecimal specific refactoring
Use BigDecimal.stripTrailingZeros() as key for getVATPercentMap and in consequence use compareTo... == 0 instead of equals Use BigDecimal.ZERO instead of new BigDecimal(0) These changes result in improvements in enumeration of the <ram:SpecifiedTradeAllowanceCharge> tags and the calculation of tag <ram:SpecifiedTradeSettlementHeaderMonetarySummation>.
This commit is contained in:
@@ -514,7 +514,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
if ((trans.getZFCharges() != null) && (trans.getZFCharges().length > 0)) {
|
||||
|
||||
for (BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||
if (!calc.getChargesForPercent(currentTaxPercent).equals(new BigDecimal(0))) {
|
||||
if (calc.getChargesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO)!=0) {
|
||||
|
||||
|
||||
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>\n" +
|
||||
@@ -537,7 +537,7 @@ public class ZUGFeRD2PullProvider implements IXMLProvider {
|
||||
|
||||
if ((trans.getZFAllowances() != null) && (trans.getZFAllowances().length > 0)) {
|
||||
for (BigDecimal currentTaxPercent : VATPercentAmountMap.keySet()) {
|
||||
if (!calc.getAllowancesForPercent(currentTaxPercent).equals(new BigDecimal(0))) {
|
||||
if (calc.getAllowancesForPercent(currentTaxPercent).compareTo(BigDecimal.ZERO)!= 0) {
|
||||
xml = xml + " <ram:SpecifiedTradeAllowanceCharge>\n" +
|
||||
" <ram:ChargeIndicator>\n" +
|
||||
" <udt:Indicator>false</udt:Indicator>\n" +
|
||||
|
||||
Reference in New Issue
Block a user