001/* Copyright (C) 2014 konik.io 002 * 003 * This file is part of the Konik library. 004 * 005 * The Konik library is free software: you can redistribute it and/or modify 006 * it under the terms of the GNU Affero General Public License as 007 * published by the Free Software Foundation, either version 3 of the 008 * License, or (at your option) any later version. 009 * 010 * The Konik library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU Affero General Public License for more details. 014 * 015 * You should have received a copy of the GNU Affero General Public License 016 * along with the Konik library. If not, see <http://www.gnu.org/licenses/>. 017 */ 018package io.konik.zugferd.entity; 019 020import io.konik.validator.annotation.Comfort; 021import io.konik.zugferd.unece.codes.TaxCategory; 022import io.konik.zugferd.unece.codes.TaxCode; 023 024import java.math.BigDecimal; 025 026import javax.validation.constraints.NotNull; 027 028/** 029 * = The trade tax 030 * 031 */ 032@Comfort 033public class AppliedTax extends CommonTax { 034 035 /** 036 * Gets the UNCL 5153 tax type code. 037 * 038 * @return the type code 039 */ 040 @Override 041 @NotNull(groups = Comfort.class) 042 public TaxCode getType() { 043 return type; 044 } 045 046 /** 047 * Sets the UNCL 5153 tax type code. 048 * 049 * @param taxTypeCode the tax type code 050 * @return the tax 051 * @see <a href="http://www.unece.org/trade/untdid/d98b/uncl/uncl5153.htm">UNCL 5153</a> 052 */ 053 @Override 054 public AppliedTax setType(TaxCode taxTypeCode) { 055 super.setType(taxTypeCode); 056 return this; 057 } 058 059 /** 060 * Gets the tax category. 061 * 062 * @return the category code 063 */ 064 @Override 065 @NotNull(groups = Comfort.class) 066 public TaxCategory getCategory() { 067 return category; 068 } 069 070 /** 071 * Sets the tax category. 072 * 073 * @param value the new category code 074 * @return the tax 075 */ 076 @Override 077 public AppliedTax setCategory(TaxCategory value) { 078 return (AppliedTax) super.setCategory(value); 079 } 080 081 /** 082 * Gets the applicable tax percentage. 083 * 084 * @return the applicable tax percentage 085 */ 086 @Override 087 @NotNull(groups = Comfort.class) 088 public BigDecimal getPercentage() { 089 return percentage; 090 } 091 092 /** 093 * Sets the applicable tax percentage. 094 * 095 * @param applicablePercentage the new applicable tax percentage 096 * @return the tax 097 */ 098 @Override 099 public AppliedTax setPercentage(BigDecimal applicablePercentage) { 100 return (AppliedTax) super.setPercentage(applicablePercentage); 101 } 102}