From 0923a01ccc1f6e9cbda0d8f0a40c4cae5c85141a Mon Sep 17 00:00:00 2001 From: jstaerk Date: Sat, 21 Nov 2020 13:04:47 +0100 Subject: [PATCH] correction of interface based intra community supply --- .../ZUGFeRD/IZUGFeRDExportableProduct.java | 43 ++++++++++--------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableProduct.java b/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableProduct.java index ae5d6bbd..55af8ee1 100644 --- a/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableProduct.java +++ b/library/src/main/java/org/mustangproject/ZUGFeRD/IZUGFeRDExportableProduct.java @@ -1,21 +1,23 @@ -/** ********************************************************************** - * +/** + * ********************************************************************* + *

* Copyright 2018 Jochen Staerk - * + *

* Use is subject to license terms. - * + *

* Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0. - * + *

* Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * + *

* See the License for the specific language governing permissions and * limitations under the License. - * - *********************************************************************** */ + *

+ * ********************************************************************** + */ package org.mustangproject.ZUGFeRD; import java.math.BigDecimal; @@ -78,7 +80,7 @@ public interface IZUGFeRDExportableProduct { /** * Get the ID that had been assigned by the seller to * identify the product - * + * * @return seller assigned product ID */ default String getSellerAssignedID() { @@ -88,33 +90,34 @@ public interface IZUGFeRDExportableProduct { /** * Get the ID that had been assigned by the buyer to * identify the product - * + * * @return buyer assigned product ID */ default String getBuyerAssignedID() { return null; } + /** * VAT percent of the product (e.g. 19, or 5.1 if you like) * * @return VAT percent of the product */ BigDecimal getVATPercent(); - + default boolean isIntraCommunitySupply() { return false; } - + default String getTaxCategoryCode() { - if (getVATPercent().equals(new BigDecimal(0))) { + if (isIntraCommunitySupply()) { + return "K"; + } else if (getVATPercent().equals(new BigDecimal(0))) { return "Z"; // zero rated goods - } else if (isIntraCommunitySupply()) { - return "K"; - } else { - return "S"; // one of the "standard" rates (not neccessarily a default rate, even a deducted VAT is standard calculation) - } - } - + } else { + return "S"; // one of the "standard" rates (not neccessarily a default rate, even a deducted VAT is standard calculation) + } + } + default String getTaxExemptionReason() { if (isIntraCommunitySupply()) return "Intra-community supply";