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.trade; 019 020import io.konik.validator.annotation.Basic; 021import io.konik.validator.annotation.Comfort; 022import io.konik.validator.annotation.Extended; 023import io.konik.zugferd.entity.trade.item.SpecifiedTax; 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; 031import javax.validation.constraints.NotNull; 032 033/** 034 * = The tax applied to a trade. 035 */ 036public class TradeTax extends SpecifiedTax { 037 038 @Basic 039 @NotNull 040 @Override 041 public Amount getCalculated() { 042 return super.getCalculated(); 043 } 044 045 @Basic 046 @Override 047 public TradeTax setCalculated(Amount calculatedAmount) { 048 return (TradeTax) super.setCalculated(calculatedAmount); 049 } 050 051 @Basic 052 @NotNull 053 @Override 054 public TaxCode getType() { 055 return super.getType(); 056 } 057 058 @Basic 059 @Override 060 public TradeTax setType(TaxCode taxTypeCode) { 061 return (TradeTax) super.setType(taxTypeCode); 062 } 063 064 /** 065 * Gets the basis amount for tax calculation. 066 * 067 * Profile:: BASIC 068 * 069 * @return the basis amount 070 */ 071 @Basic 072 @Valid 073 @NotNull 074 public Amount getBasis() { 075 return basis; 076 } 077 078 /** 079 * Sets the basis amount for tax calculation. 080 * 081 * Profile:: BASIC 082 * 083 * @param basisAmount the new basis amount 084 * @return the tax 085 */ 086 public TradeTax setBasis(Amount basisAmount) { 087 this.basis = basisAmount; 088 return this; 089 } 090 091 /** 092 * Gets the line total. 093 * 094 * @return the line total 095 */ 096 @Extended 097 public Amount getLineTotal() { 098 return lineTotal; 099 } 100 101 /** 102 * Sets the line total. 103 * 104 * @param lineTotal the new line total 105 */ 106 public void setLineTotal(Amount lineTotal) { 107 this.lineTotal = lineTotal; 108 } 109 110 /** 111 * Gets the allowance charge. 112 * 113 * @return the allowance charge 114 */ 115 @Valid 116 @Extended 117 public Amount getAllowanceCharge() { 118 return allowanceCharge; 119 } 120 121 /** 122 * Sets the allowance charge. 123 * 124 * @param allowanceCharge the new allowance charge 125 */ 126 public void setAllowanceCharge(Amount allowanceCharge) { 127 this.allowanceCharge = allowanceCharge; 128 } 129 130 @Comfort 131 @Override 132 public TaxCategory getCategory() { 133 return super.getCategory(); 134 } 135 136 @Override 137 public TradeTax setCategory(TaxCategory value) { 138 return (TradeTax) super.setCategory(value); 139 } 140 141 @NotNull 142 @Basic 143 @Override 144 public BigDecimal getPercentage() { 145 return super.getPercentage(); 146 } 147 148 @Basic 149 @Override 150 public TradeTax setPercentage(BigDecimal applicablePercentage) { 151 return (TradeTax) super.setPercentage(applicablePercentage); 152 } 153 154 @Override 155 public TradeTax setExemptionReason(String exemptionReason) { 156 super.setExemptionReason(exemptionReason); 157 return this; 158 } 159 160}