Use constants instead of magic numbers

This commit is contained in:
Sebastian Sieber
2020-12-01 15:58:18 +01:00
parent 1ab13e749d
commit 687d8f628c

View File

@@ -22,6 +22,8 @@ package org.mustangproject.ZUGFeRD;
import java.math.BigDecimal; import java.math.BigDecimal;
import org.mustangproject.ZUGFeRD.model.TaxCategoryCodeTypeConstants;
/** /**
* Mustangproject's ZUGFeRD implementation * Mustangproject's ZUGFeRD implementation
* Necessary interface for ZUGFeRD exporter * Necessary interface for ZUGFeRD exporter
@@ -114,13 +116,15 @@ public interface IZUGFeRDExportableProduct {
default String getTaxCategoryCode() { default String getTaxCategoryCode() {
if (isIntraCommunitySupply()) { if (isIntraCommunitySupply()) {
return "K"; // within europe return TaxCategoryCodeTypeConstants.INTRACOMMUNITY;// "K"; // within europe
} else if (isReverseCharge()) { } else if (isReverseCharge()) {
return "AE"; // to out of europe... return TaxCategoryCodeTypeConstants.REVERSECHARGE;// "AE"; // to out of europe...
} else if (getVATPercent().equals(BigDecimal.ZERO)) { } else if (getVATPercent().equals(BigDecimal.ZERO)) {
return "Z"; // zero rated goods return TaxCategoryCodeTypeConstants.ZEROTAXPRODUCTS; // "Z"; // zero rated goods
} else { } else {
return "S"; // one of the "standard" rates (not neccessarily a default rate, even a deducted VAT is standard calculation) return TaxCategoryCodeTypeConstants.STANDARDRATE;// "S"; // one of the "standard" rates (not
// neccessarily a default rate, even a deducted VAT
// is standard calculation)
} }
} }