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;
|
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) {
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user