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.item; 019 020import io.konik.zugferd.entity.CommonDelivery; 021import io.konik.zugferd.unqualified.Quantity; 022import io.konik.zugferd.unqualified.ZfDate; 023 024import java.util.List; 025 026import javax.validation.Valid; 027import javax.validation.constraints.NotNull; 028import javax.xml.bind.annotation.XmlAccessType; 029import javax.xml.bind.annotation.XmlAccessorType; 030import javax.xml.bind.annotation.XmlElement; 031import javax.xml.bind.annotation.XmlType; 032 033/** 034 * = The Trade Delivery 035 * 036 * Profile:: EXTENDED 037 */ 038@XmlAccessorType(XmlAccessType.NONE) 039@XmlType(propOrder = { "billed", "chargeFree", "packageQuantity", "shipTo", "ultimateShipTo", "actualDelivery", 040 "despatchAdvice", "receivingAdvice", "deliveryNote" }) 041public class SpecifiedDelivery extends CommonDelivery<ReferencedDocumentItem> { 042 043 @Valid 044 @NotNull 045 @XmlElement(name = "BilledQuantity") 046 private Quantity billed; 047 048 @Valid 049 @XmlElement(name = "ChargeFreeQuantity") 050 private Quantity chargeFree; 051 052 @Valid 053 @XmlElement(name = "PackageQuantity") 054 private Quantity packageQuantity; 055 056 @Valid 057 @XmlElement(name = "DespatchAdviceReferencedDocument") 058 private ReferencedDocumentItem despatchAdvice; 059 060 @Valid 061 @XmlElement(name = "ReceivingAdviceReferencedDocument") 062 private List<ReferencedDocumentItem> receivingAdvice; 063 064 @Valid 065 @XmlElement(name = "DeliveryNoteReferencedDocument") 066 private ReferencedDocumentItem deliveryNote; 067 068 /** Instantiates a new trade delivery. */ 069 public SpecifiedDelivery() { 070 } 071 072 /** 073 * The Constructor. 074 * 075 * Profile:: BASIC 076 * 077 * @param billed the billed 078 */ 079 public SpecifiedDelivery(Quantity billed) { 080 super(); 081 this.billed = billed; 082 } 083 084 /** 085 * The Constructor. 086 * 087 * Profile:: EXTENDED 088 * 089 * @param billed the billed 090 * @param actualDelivery the actual delivery 091 */ 092 public SpecifiedDelivery(Quantity billed, ZfDate actualDelivery) { 093 super(); 094 this.billed = billed; 095 setActualDelivery(actualDelivery); 096 } 097 098 /** 099 * Gets the billed quantity. 100 * 101 * Profile:: BASIC 102 * 103 * @return the billed quantity 104 */ 105 public Quantity getBilled() { 106 return billed; 107 } 108 109 /** 110 * Sets the billed quantity. 111 * 112 * Profile:: BASIC 113 * 114 * @param billedQuantity the new billed quantity 115 * @return the delivery 116 */ 117 public SpecifiedDelivery setBilled(Quantity billedQuantity) { 118 this.billed = billedQuantity; 119 return this; 120 } 121 122 /** 123 * Gets the charge free. 124 * 125 * @return the charge free 126 */ 127 public Quantity getChargeFree() { 128 return chargeFree; 129 } 130 131 /** 132 * Sets the charge free. 133 * 134 * @param chargeFree the charge free 135 * @return the item delivery 136 */ 137 public SpecifiedDelivery setChargeFree(Quantity chargeFree) { 138 this.chargeFree = chargeFree; 139 return this; 140 } 141 142 /** 143 * Gets the package quantity. 144 * 145 * @return the package quantity 146 */ 147 public Quantity getPackageQuantity() { 148 return packageQuantity; 149 } 150 151 /** 152 * Sets the package quantity. 153 * 154 * @param packageQuantity the package quantity 155 * @return the item delivery 156 */ 157 public SpecifiedDelivery setPackageQuantity(Quantity packageQuantity) { 158 this.packageQuantity = packageQuantity; 159 return this; 160 } 161 162 @Override 163 public ReferencedDocumentItem getDespatchAdvice() { 164 return despatchAdvice; 165 } 166 167 @Override 168 public SpecifiedDelivery setDespatchAdvice(ReferencedDocumentItem despatchAdvice) { 169 this.despatchAdvice = despatchAdvice; 170 return this; 171 } 172 173 /** 174 * Gets the receiving advice. 175 * 176 * @return the receiving advice 177 */ 178 public List<ReferencedDocumentItem> getReceivingAdvice() { 179 return receivingAdvice; 180 } 181 182 /** 183 * Sets the receiving advice. 184 * 185 * @param receivingAdvice the receiving advice 186 * @return the item delivery 187 */ 188 public SpecifiedDelivery setReceivingAdvice(List<ReferencedDocumentItem> receivingAdvice) { 189 this.receivingAdvice = receivingAdvice; 190 return this; 191 } 192 193 @Override 194 public ReferencedDocumentItem getDeliveryNote() { 195 return deliveryNote; 196 } 197 198 @Override 199 public SpecifiedDelivery setDeliveryNote(ReferencedDocumentItem deliveryNote) { 200 this.deliveryNote = deliveryNote; 201 return this; 202 } 203}