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.unqualified.Amount;
022
023import java.util.ArrayList;
024import java.util.List;
025
026import javax.validation.Valid;
027import javax.xml.bind.annotation.XmlAccessType;
028import javax.xml.bind.annotation.XmlAccessorType;
029import javax.xml.bind.annotation.XmlElement;
030import javax.xml.bind.annotation.XmlType;
031
032
033/**
034 * = The Logistics Service Charge
035 * 
036 * Represents the transport and packaging costs.
037 */
038@XmlAccessorType(XmlAccessType.FIELD)
039@XmlType(name = "LogisticsServiceChargeType", propOrder = { "description", "amount", "tradeTax" })
040public class LogisticsServiceCharge {
041
042        @XmlElement(name = "Description")
043        private String description;
044        
045        @Valid
046        @XmlElement(name = "AppliedAmount")
047        private Amount amount;
048
049        @Valid
050        @XmlElement(name = "AppliedTradeTax")
051        private List<Tax> tradeTax;
052
053        /**
054         * Gets the description.
055         * 
056         * @return the description
057         */
058        public String getDescription() {
059                return description;
060        }
061
062        /**
063         * Sets the description.
064         * 
065         * @param description the new description
066         * @return the logistics service charge
067         */
068        public LogisticsServiceCharge setDescription(String description) {
069                this.description = description;
070                return this;
071        }
072
073        /**
074         * Gets the applied amount.
075         * 
076         * @return the applied amount
077         */
078        public Amount getAmount() {
079                return amount;
080        }
081
082        /**
083    * Sets the applied amount.
084    *
085    * @param amount the new applied amount
086    * @return the logistics service charge
087    */
088        public LogisticsServiceCharge setAmount(Amount amount) {
089                this.amount = amount;
090                return this;
091        }
092
093        /**
094         * Gets the applied trade tax.
095         * 
096         * @return the applied trade tax
097         */
098        public List<Tax> getTradeTax() {
099                if (tradeTax == null) {
100                        tradeTax = new ArrayList<Tax>();
101                }
102                return this.tradeTax;
103        }
104
105
106        /**
107    * Adds a trade tax.
108    *
109    * @param additionalTradeTax the additional trade tax
110    * @return the logistics service charge
111    */
112        public LogisticsServiceCharge addTradeTax(Tax additionalTradeTax) {
113                getTradeTax().add(additionalTradeTax);
114                return this;
115        }
116
117}