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;
020
021import io.konik.zugferd.unece.codes.TaxCategory;
022import io.konik.zugferd.unece.codes.TaxCode;
023import io.konik.zugferd.unqualified.Amount;
024
025import java.math.BigDecimal;
026
027import javax.validation.Valid;
028import javax.xml.bind.annotation.XmlAccessType;
029import javax.xml.bind.annotation.XmlAccessorType;
030import javax.xml.bind.annotation.XmlElement;
031import javax.xml.bind.annotation.XmlType;
032
033
034/**
035 * = The Trade Tax.
036 */
037@XmlAccessorType(XmlAccessType.FIELD)
038@XmlType(name = "TradeTaxType", propOrder = { "calculatedAmount", "code", "exemptionReason","basisAmount", "category", "applicablePercentage" })
039public class Tax {
040
041   @Valid
042        @XmlElement(name = "CalculatedAmount")
043        private Amount calculatedAmount;
044
045   @Valid
046        @XmlElement(name = "TypeCode")
047        private TaxCode code;
048
049        @XmlElement(name = "ExemptionReason")
050        private String exemptionReason;
051
052        @Valid
053        @XmlElement(name = "BasisAmount")
054        private Amount basisAmount;
055
056        @XmlElement(name = "CategoryCode")
057        private TaxCategory category;
058
059        @XmlElement(name = "ApplicablePercent")
060        private BigDecimal applicablePercentage;
061
062        /**
063         * Gets the calculated amount.
064         * 
065         * Profile:: BASIC
066         * 
067         * @return the calculated amount
068         */
069        public Amount getCalculatedAmount() {
070                return calculatedAmount;
071        }
072
073        /**
074    * Sets the calculated amount.
075    * 
076    * Profile:: BASIC
077    *
078    * @param calculatedAmount the new calculated amount
079    * @return the tax
080    */
081        public Tax setCalculatedAmount(Amount calculatedAmount) {
082                this.calculatedAmount = calculatedAmount;
083                return this;
084        }
085
086        /**
087         * Gets the UNCL 5153 tax type code.
088         * 
089         * Profile:: BASIC
090         * 
091         * @return the type code
092         */
093        public TaxCode getCode() {
094                return code;
095        }
096
097        /**
098    * Sets the UNCL 5153 tax type code.
099    * 
100    * Profile:: BASIC
101    *
102    * @param taxCode the new type code
103    * @return the tax
104    * @see <a href="http://www.unece.org/trade/untdid/d98b/uncl/uncl5153.htm">UNCL 5153</a>
105    */
106        public Tax setCode(TaxCode taxCode) {
107                this.code = taxCode;
108                return this;
109        }
110
111        /**
112         * Gets the tax exemption reason.
113         * 
114         * Profile:: COMFORT
115         * 
116         * @return the exemption reason
117         */
118        public String getExemptionReason() {
119                return exemptionReason;
120        }
121
122        /**
123    * Sets the tax exemption reason.
124    * 
125    * Profile:: COMFORT
126    *
127    * @param exemptionReason the new exemption reason
128    * @return the tax
129    */
130        public Tax setExemptionReason(String exemptionReason) {
131                this.exemptionReason = exemptionReason;
132                return this;
133        }
134
135        /**
136         * Gets the basis amount for tax calculation.
137         * 
138         * Profile:: BASIC
139         * 
140         * @return the basis amount
141         */
142        public Amount getBasisAmount() {
143                return basisAmount;
144        }
145
146        /**
147    * Sets the basis amount for tax calculation.
148    * 
149    * Profile:: BASIC
150    *
151    * @param basisAmount the new basis amount
152    * @return the tax
153    */
154        public Tax setBasisAmount(Amount basisAmount) {
155                this.basisAmount = basisAmount;
156                return this;
157        }
158
159        /**
160         * Gets the tax category.
161         * 
162         * Profile:: COMFORT
163         * 
164         * @return the category code
165         */
166        public TaxCategory getCategory() {
167                return category;
168        }
169
170        /**
171    * Sets the tax category.
172    * 
173    * Profile:: COMFORT
174    *
175    * @param value the new category code
176    * @return the tax
177    */
178        public Tax setCategory(TaxCategory value) {
179                this.category = value;
180                return this;
181        }
182
183        /**
184         * Gets the applicable tax percentage.
185         * 
186         * Profile:: BASIC
187         * 
188         * 
189         * @return the applicable tax percentage
190         */
191        public BigDecimal getApplicablePercentage() {
192                return applicablePercentage;
193        }
194
195        /**
196    * Sets the applicable tax percentage.
197    * 
198    * Profile:: BASIC
199    *
200    * @param applicablePercentage the new applicable tax percentage
201    * @return the tax
202    */
203        public Tax setApplicablePercentage(BigDecimal applicablePercentage) {
204                this.applicablePercentage = applicablePercentage;
205                return this;
206        }
207
208}