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