From 687d8f628c8d494827d6873592be0b061627a70f Mon Sep 17 00:00:00 2001 From: Sebastian Sieber Date: Tue, 1 Dec 2020 15:58:18 +0100 Subject: [PATCH] Use constants instead of magic numbers --- .../ZUGFeRD/IZUGFeRDExportableProduct.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableProduct.java b/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableProduct.java index efab767d..92d32e91 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableProduct.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableProduct.java @@ -22,6 +22,8 @@ package org.mustangproject.ZUGFeRD; import java.math.BigDecimal; +import org.mustangproject.ZUGFeRD.model.TaxCategoryCodeTypeConstants; + /** * Mustangproject's ZUGFeRD implementation * Necessary interface for ZUGFeRD exporter @@ -114,13 +116,15 @@ public interface IZUGFeRDExportableProduct { default String getTaxCategoryCode() { if (isIntraCommunitySupply()) { - return "K"; // within europe + return TaxCategoryCodeTypeConstants.INTRACOMMUNITY;// "K"; // within europe } else if (isReverseCharge()) { - return "AE"; // to out of europe... + return TaxCategoryCodeTypeConstants.REVERSECHARGE;// "AE"; // to out of europe... } else if (getVATPercent().equals(BigDecimal.ZERO)) { - return "Z"; // zero rated goods + return TaxCategoryCodeTypeConstants.ZEROTAXPRODUCTS; // "Z"; // zero rated goods } 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) } }