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