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 */
032public class AppliedTax extends CommonTax {
033
034   /**
035    * Gets the UNCL 5153 tax type code.
036    * 
037    * Profile:: COMFORT
038    * 
039    * @return the type code
040    */
041   @Override
042   @Comfort
043   @NotNull(groups = Comfort.class)
044   public TaxCode getType() {
045      return type;
046   }
047
048   /**
049    * Sets the UNCL 5153 tax type code.
050    * 
051    * Profile:: BASIC
052    *
053    * @param taxTypeCode the tax type code
054    * @return the tax
055    * @see <a href="http://www.unece.org/trade/untdid/d98b/uncl/uncl5153.htm">UNCL 5153</a>
056    */
057   @Override
058   public AppliedTax setType(TaxCode taxTypeCode) {
059      super.setType(taxTypeCode);
060      return this;
061   }
062
063   /**
064    * Gets the tax category.
065    * 
066    * Profile:: COMFORT
067    * 
068    * @return the category code
069    */
070   @Override
071   @Comfort
072   @NotNull(groups = Comfort.class)
073   public TaxCategory getCategory() {
074      return category;
075   }
076
077   /**
078    * Sets the tax category.
079    * 
080    * Profile:: COMFORT
081    *
082    * @param value the new category code
083    * @return the tax
084    */
085   @Override
086   public AppliedTax setCategory(TaxCategory value) {
087      return (AppliedTax) super.setCategory(value);
088   }
089
090   /**
091    * Gets the applicable tax percentage.
092    * 
093    * Profile:: COMFORT
094    * 
095    * @return the applicable tax percentage
096    */
097   @Override
098   @Comfort
099   public BigDecimal getPercentage() {
100      return percentage;
101   }
102
103   /**
104    * Sets the applicable tax percentage.
105    * 
106    * Profile:: BASIC
107    *
108    * @param applicablePercentage the new applicable tax percentage
109    * @return the tax
110    */
111   @Override
112   public AppliedTax setPercentage(BigDecimal applicablePercentage) {
113      return (AppliedTax) super.setPercentage(applicablePercentage);
114   }
115}