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.unece.codes;
019
020import javax.xml.bind.annotation.XmlType;
021
022/**
023 * = The Tax Category Code.
024 *
025 * Based on 5305 Duty or tax or fee category code
026 * 
027 * @see http://www.unece.org/trade/untdid/d13b/tred/tred5305.htm[UN/EDIFACT 5305 Duty or tax or fee category code^]
028 * 
029 */
030@XmlType(name = "TaxCategoryCodeType")
031public enum TaxCategory {
032
033   /**
034    * Mixed tax rate
035    * 
036    * Code specifying that the rate is based on mixed tax.
037    **/
038   A("Mixed tax rate", "Code specifying that the rate is based on mixed tax."),
039
040   /**
041    * Lower rate
042    * 
043    * Tax rate is lower than standard rate.
044    **/
045   AA("Lower rate", "Tax rate is lower than standard rate."),
046
047   /**
048    * Exempt for resale
049    * 
050    * A tax category code indicating the item is tax exempt
051    * when the item is bought for future resale.
052    **/
053   AB("Exempt for resale",
054         "A tax category code indicating the item is tax exempt when the item is bought for future resale."),
055
056   /**
057    * Value Added Tax (VAT) not now due for payment
058    * 
059    * A code to indicate that the Value Added Tax (VAT) amount
060    * which is due on the current invoice is to be paid on
061    * receipt of a separate VAT payment request.
062    **/
063   AC(
064         "Value Added Tax (VAT) not now due for payment",
065         " A code to indicate that the Value Added Tax (VAT) amount which is due on the current invoice is to be paid on receipt of a separate VAT payment request."),
066
067   /**
068    * Value Added Tax (VAT) due from a previous invoice
069    * 
070    * A code to indicate that the Value Added Tax (VAT) amount
071    * of a previous invoice is to be paid.
072    **/
073   AD("Value Added Tax (VAT) due from a previous invoice",
074         "A code to indicate that the Value Added Tax (VAT) amount of a previous invoice is to be paid."),
075
076   /**
077    * VAT Reverse Charge
078    * 
079    * Code specifying that the standard VAT rate is levied
080    * from the invoicee.
081    **/
082   AE("VAT Reverse Charge", "Code specifying that the standard VAT rate is levied from the invoicee."),
083
084   /**
085    * Transferred (VAT)
086    * 
087    * VAT not to be paid to the issuer of the invoice but
088    * directly to relevant tax authority.
089    **/
090   B("Transferred (VAT)", "VAT not to be paid to the issuer of the invoice but directly to relevant tax authority."),
091
092   /**
093    * Duty paid by supplier
094    * 
095    * Duty associated with shipment of goods is paid by the
096    * supplier; customer receives goods with duty paid.
097    **/
098   C("Duty paid by supplier",
099         "Duty associated with shipment of goods is paid by the supplier; customer receives goods with duty paid."),
100
101   /**
102    * Exempt from tax
103    * 
104    * Code specifying that taxes are not applicable.
105    **/
106   E("Exempt from tax", "Code specifying that taxes are not applicable."),
107
108   /**
109    * Free export item, tax not charged
110    * 
111    * Code specifying that the item is free export and taxes
112    * are not charged.
113    **/
114   G("Free export item, tax not charged", "Code specifying that the item is free export and taxes are not charged."),
115
116   /**
117    * Higher rate
118    * 
119    * Code specifying a higher rate of duty or tax or fee.
120    **/
121   H("Higher rate", "Code specifying a higher rate of duty or tax or fee."),
122
123   /**
124    * Intra-Community Supply
125    * 
126    * Code specifying that the VAT rate is levied from the invoicee for Intra-Community supplies.
127    **/
128   IC("Intra-Community Supply", "Code specifying that the VAT rate is levied from the invoicee for Intra-Community supplies."),
129   
130   /**
131    * Services outside scope of tax
132    * 
133    * Code specifying that taxes are not applicable to the
134    * services.
135    **/
136   O("Services outside scope of tax", "Code specifying that taxes are not applicable to the services."),
137
138   /**
139    * Standard rate
140    * 
141    * Code specifying the standard rate.
142    **/
143   S("Standard rate", "Code specifying the standard rate."),
144
145   /**
146    * Zero rated goods
147    * 
148    * Code specifying that the goods are at a zero rate.
149    **/
150   Z("Zero rated goods", "Code specifying that the goods are at a zero rate.");
151
152   private final String description;
153
154   private final String detailedDescription;
155
156   private TaxCategory(String description, String detailedDescription) {
157      this.description = description;
158      this.detailedDescription = detailedDescription;
159   }
160
161   /**
162    * Gets the code.
163    *
164    * @return the code
165    */
166   public String getCode() {
167      return name();
168   }
169
170   /**
171    * Gets the description.
172    *
173    * @return the description
174    */
175   public String getDescription() {
176      return description;
177   }
178
179   /**
180    * Gets the detailed description.
181    *
182    * @return the detailed description
183    */
184   public String getDetailedDescription() {
185      return detailedDescription;
186   }
187
188   /**
189    * Retrieves a TaxCategoryCode the by the given code.
190    *
191    * @param code the code
192    * @return the by code
193    */
194   public static TaxCategory getByCode(String code) {
195      return valueOf(code);
196   }
197
198   @Override
199   public String toString() {
200      return new StringBuilder().append("[").append(getCode()).append("] ").append(description).toString();
201   }
202
203}