correcting some tests
This commit is contained in:
@@ -145,9 +145,8 @@ public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
if(totalAmount != null) {
|
||||
return totalAmount;
|
||||
} else if (percent!=null) {
|
||||
// BigDecimal singlePrice=currentItem.getValue().divide(BigDecimal.ONE.add(getPercent().divide(new BigDecimal(100))), 18, RoundingMode.HALF_UP);
|
||||
BigDecimal singlePrice=currentItem.getValue().multiply(BigDecimal.ONE.subtract(getPercent().divide(new BigDecimal(100))));
|
||||
// BigDecimal singlePriceDiff=currentItem.getValue().add(singlePrice);
|
||||
BigDecimal factor=getPercent().divide(new BigDecimal(100), 18, RoundingMode.HALF_UP);
|
||||
BigDecimal singlePrice=currentItem.getValue().multiply(factor);
|
||||
return singlePrice;
|
||||
} else {
|
||||
throw new RuntimeException("percent must be set");
|
||||
|
||||
@@ -172,6 +172,7 @@ public class TransactionCalculator implements IAbsoluteValueProvider {
|
||||
* @return item sum +- charges/allowances
|
||||
*/
|
||||
public BigDecimal getTaxBasis() {
|
||||
BigDecimal debug_1=getTotal();
|
||||
return getTotal().add(getChargesForPercent(null).setScale(2, RoundingMode.HALF_UP))
|
||||
.subtract(getAllowancesForPercent(null).setScale(2, RoundingMode.HALF_UP))
|
||||
.setScale(2, RoundingMode.HALF_UP);
|
||||
|
||||
Reference in New Issue
Block a user