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:
@@ -82,6 +82,13 @@ public class Charge implements IZUGFeRDAllowanceCharge {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategoryCode() {
|
||||
if(categoryCode != null){
|
||||
return categoryCode;
|
||||
}
|
||||
return IZUGFeRDAllowanceCharge.super.getCategoryCode();
|
||||
}
|
||||
|
||||
|
||||
public Charge setCategoryCode(String categoryCode) {
|
||||
|
||||
@@ -119,7 +119,7 @@ public interface IZUGFeRDExportableProduct {
|
||||
return TaxCategoryCodeTypeConstants.INTRACOMMUNITY;// "K"; // within europe
|
||||
} else if (isReverseCharge()) {
|
||||
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
|
||||
} else {
|
||||
return TaxCategoryCodeTypeConstants.STANDARDRATE;// "S"; // one of the "standard" rates (not
|
||||
|
||||
Reference in New Issue
Block a user