Improve handling of categoryCode

Charge returns the local field if is set.
IZUGFeRDExportableProduct: Use compareTo instead of equals to check the mathematical equality.
This commit is contained in:
Sebastian Sieber
2020-12-02 11:28:09 +01:00
parent 687d8f628c
commit 5e71863f8b
2 changed files with 8 additions and 1 deletions

View File

@@ -82,6 +82,13 @@ public class Charge implements IZUGFeRDAllowanceCharge {
return true; return true;
} }
@Override
public String getCategoryCode() {
if(categoryCode != null){
return categoryCode;
}
return IZUGFeRDAllowanceCharge.super.getCategoryCode();
}
public Charge setCategoryCode(String categoryCode) { public Charge setCategoryCode(String categoryCode) {

View File

@@ -119,7 +119,7 @@ public interface IZUGFeRDExportableProduct {
return TaxCategoryCodeTypeConstants.INTRACOMMUNITY;// "K"; // within europe return TaxCategoryCodeTypeConstants.INTRACOMMUNITY;// "K"; // within europe
} else if (isReverseCharge()) { } else if (isReverseCharge()) {
return TaxCategoryCodeTypeConstants.REVERSECHARGE;// "AE"; // to out of europe... return TaxCategoryCodeTypeConstants.REVERSECHARGE;// "AE"; // to out of europe...
} else if (getVATPercent().equals(BigDecimal.ZERO)) { } else if (getVATPercent().compareTo(BigDecimal.ZERO) == 0) {
return TaxCategoryCodeTypeConstants.ZEROTAXPRODUCTS; // "Z"; // zero rated goods return TaxCategoryCodeTypeConstants.ZEROTAXPRODUCTS; // "Z"; // zero rated goods
} else { } else {
return TaxCategoryCodeTypeConstants.STANDARDRATE;// "S"; // one of the "standard" rates (not return TaxCategoryCodeTypeConstants.STANDARDRATE;// "S"; // one of the "standard" rates (not