Merge branch 'master' of github.com:ZUGFeRD/mustangproject

# Conflicts:
#	History.md
This commit is contained in:
jstaerk
2020-11-24 10:12:27 +01:00
2 changed files with 7 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
2.0.2 2.0.2
===== =======
- #197 file attachments
- #197 xml attachment errors - Charges/Allowances CategoryCode improvement PR #198 Thanks to weclapp-dev
2.0.1 2.0.1
===== =====

View File

@@ -162,7 +162,8 @@ public class TransactionCalculator implements IAbsoluteValueProvider {
for (IZUGFeRDAllowanceCharge currentCharge : charges) { for (IZUGFeRDAllowanceCharge currentCharge : charges) {
VATAmount theAmount = hm.get(currentCharge.getTaxPercent().stripTrailingZeros()); VATAmount theAmount = hm.get(currentCharge.getTaxPercent().stripTrailingZeros());
if (theAmount == null) { if (theAmount == null) {
theAmount = new VATAmount(BigDecimal.ZERO, BigDecimal.ZERO, "S"); theAmount = new VATAmount(BigDecimal.ZERO, BigDecimal.ZERO,
currentCharge.getCategoryCode()!=null?currentCharge.getCategoryCode():"S");
} }
theAmount.setBasis(theAmount.getBasis().add(currentCharge.getTotalAmount(this))); theAmount.setBasis(theAmount.getBasis().add(currentCharge.getTotalAmount(this)));
BigDecimal factor = currentCharge.getTaxPercent().divide(new BigDecimal(100)); BigDecimal factor = currentCharge.getTaxPercent().divide(new BigDecimal(100));
@@ -175,7 +176,8 @@ public class TransactionCalculator implements IAbsoluteValueProvider {
for (IZUGFeRDAllowanceCharge currentAllowance : allowances) { for (IZUGFeRDAllowanceCharge currentAllowance : allowances) {
VATAmount theAmount = hm.get(currentAllowance.getTaxPercent().stripTrailingZeros()); VATAmount theAmount = hm.get(currentAllowance.getTaxPercent().stripTrailingZeros());
if (theAmount == null) { if (theAmount == null) {
theAmount = new VATAmount(BigDecimal.ZERO, BigDecimal.ZERO, "S"); theAmount = new VATAmount(BigDecimal.ZERO, BigDecimal.ZERO,
currentAllowance.getCategoryCode()!=null?currentAllowance.getCategoryCode():"S");
} }
theAmount.setBasis(theAmount.getBasis().subtract(currentAllowance.getTotalAmount(this))); theAmount.setBasis(theAmount.getBasis().subtract(currentAllowance.getTotalAmount(this)));
BigDecimal factor = currentAllowance.getTaxPercent().divide(new BigDecimal(100)); BigDecimal factor = currentAllowance.getTaxPercent().divide(new BigDecimal(100));