correction of interface based intra community supply

This commit is contained in:
jstaerk
2020-11-21 13:04:47 +01:00
parent 39d98d1e9d
commit 0923a01ccc

View File

@@ -1,21 +1,23 @@
/** ********************************************************************** /**
* * *********************************************************************
* <p>
* Copyright 2018 Jochen Staerk * Copyright 2018 Jochen Staerk
* * <p>
* Use is subject to license terms. * Use is subject to license terms.
* * <p>
* Licensed under the Apache License, Version 2.0 (the "License"); you may not * 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 * 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. * of the License at http://www.apache.org/licenses/LICENSE-2.0.
* * <p>
* Unless required by applicable law or agreed to in writing, software * Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* * <p>
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
* * <p>
*********************************************************************** */ * **********************************************************************
*/
package org.mustangproject.ZUGFeRD; package org.mustangproject.ZUGFeRD;
import java.math.BigDecimal; import java.math.BigDecimal;
@@ -94,6 +96,7 @@ public interface IZUGFeRDExportableProduct {
default String getBuyerAssignedID() { default String getBuyerAssignedID() {
return null; return null;
} }
/** /**
* VAT percent of the product (e.g. 19, or 5.1 if you like) * VAT percent of the product (e.g. 19, or 5.1 if you like)
* *
@@ -106,10 +109,10 @@ public interface IZUGFeRDExportableProduct {
} }
default String getTaxCategoryCode() { default String getTaxCategoryCode() {
if (getVATPercent().equals(new BigDecimal(0))) { if (isIntraCommunitySupply()) {
return "Z"; // zero rated goods
} else if (isIntraCommunitySupply()) {
return "K"; return "K";
} else if (getVATPercent().equals(new BigDecimal(0))) {
return "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 "S"; // one of the "standard" rates (not neccessarily a default rate, even a deducted VAT is standard calculation)
} }