diff --git a/History.md b/History.md index ec7b709e..1a5f7fc3 100644 --- a/History.md +++ b/History.md @@ -1,7 +1,7 @@ 2.0.2 -===== - -- #197 xml attachment errors +======= +- #197 file attachments +- Charges/Allowances CategoryCode improvement PR #198 Thanks to weclapp-dev 2.0.1 ===== diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/TransactionCalculator.java b/library/src/main/java/org/mustangproject/ZUGFeRD/TransactionCalculator.java index f293b23d..bdb6f6e8 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/TransactionCalculator.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/TransactionCalculator.java @@ -162,7 +162,8 @@ public class TransactionCalculator implements IAbsoluteValueProvider { for (IZUGFeRDAllowanceCharge currentCharge : charges) { VATAmount theAmount = hm.get(currentCharge.getTaxPercent().stripTrailingZeros()); 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))); BigDecimal factor = currentCharge.getTaxPercent().divide(new BigDecimal(100)); @@ -175,7 +176,8 @@ public class TransactionCalculator implements IAbsoluteValueProvider { for (IZUGFeRDAllowanceCharge currentAllowance : allowances) { VATAmount theAmount = hm.get(currentAllowance.getTaxPercent().stripTrailingZeros()); 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))); BigDecimal factor = currentAllowance.getTaxPercent().divide(new BigDecimal(100));