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 */
018
019package io.konik.zugferd.entity;
020
021import io.konik.jaxb.bindable.unqualified.PercentRoundingAdapter;
022import io.konik.zugferd.unqualified.Amount;
023import io.konik.zugferd.unqualified.Measure;
024import io.konik.zugferd.unqualified.ZfDate;
025
026import java.math.BigDecimal;
027
028import javax.validation.Valid;
029import javax.xml.bind.annotation.XmlAccessType;
030import javax.xml.bind.annotation.XmlAccessorType;
031import javax.xml.bind.annotation.XmlElement;
032import javax.xml.bind.annotation.XmlType;
033import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
034
035/**
036 * 
037 * The Class PaymentDiscountTerm.
038 */
039@XmlAccessorType(XmlAccessType.FIELD)
040@XmlType(name = "TradePaymentDiscountTermsType", propOrder = { "reference", "maturityPeriod", "basis",
041      "calculationPercent", "actualDiscount" })
042public class PaymentDiscountTerms {
043
044   @XmlElement(name = "BasisDateTime")
045   private ZfDate reference;
046
047   @Valid
048   @XmlElement(name = "BasisPeriodMeasure")
049   private Measure maturityPeriod;
050
051   @Valid
052   @XmlElement(name = "BasisAmount")
053   private Amount basis;
054
055   @XmlElement(name = "CalculationPercent")
056   @XmlJavaTypeAdapter(PercentRoundingAdapter.class)
057   private BigDecimal calculationPercent;
058
059   @Valid
060   @XmlElement(name = "ActualDiscountAmount")
061   private Amount actualDiscount;
062
063   /**
064    * Gets the reference.
065    *
066    * @return the reference
067    */
068   public ZfDate getReference() {
069      return reference;
070   }
071
072   /**
073    * Sets the reference.
074    *
075    * @param reference the reference
076    * @return the payment discount term
077    */
078   public PaymentDiscountTerms setReference(ZfDate reference) {
079      this.reference = reference;
080      return this;
081   }
082
083   /**
084    * Gets the maturity period.
085    *
086    * @return the maturity period
087    */
088   public Measure getMaturityPeriod() {
089      return maturityPeriod;
090   }
091
092   /**
093    * Sets the maturity period.
094    *
095    * @param maturityPeriod the maturity period
096    * @return the payment discount term
097    */
098   public PaymentDiscountTerms setMaturityPeriod(Measure maturityPeriod) {
099      this.maturityPeriod = maturityPeriod;
100      return this;
101   }
102
103   /**
104    * Gets the basis discount.
105    *
106    * @return the basis discount
107    */
108   public Amount getBasis() {
109      return basis;
110   }
111
112   /**
113    * Sets the basis discount.
114    *
115    * @param basisDiscount the basis discount
116    * @return the payment discount term
117    */
118   public PaymentDiscountTerms setBasis(Amount basisDiscount) {
119      this.basis = basisDiscount;
120      return this;
121   }
122
123   /**
124    * Gets the calculation percent.
125    *
126    * @return the calculation percent
127    */
128   public BigDecimal getCalculationPercent() {
129      return calculationPercent;
130   }
131
132   /**
133    * Sets the calculation percent.
134    *
135    * @param calculationPercent the calculation percent
136    * @return the payment discount term
137    */
138   public PaymentDiscountTerms setCalculationPercent(BigDecimal calculationPercent) {
139      this.calculationPercent = calculationPercent;
140      return this;
141   }
142
143   /**
144    * Gets the actual discount.
145    *
146    * @return the actual discount
147    */
148   public Amount getActualDiscount() {
149      return actualDiscount;
150   }
151
152   /**
153    * Sets the actual discount.
154    *
155    * @param actualDiscount the actual discount
156    * @return the payment discount term
157    */
158   public PaymentDiscountTerms setActualDiscount(Amount actualDiscount) {
159      this.actualDiscount = actualDiscount;
160      return this;
161   }
162
163}