1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.kuali.ole.vnd.businessobject;
18
19 import java.sql.Date;
20 import java.util.ArrayList;
21 import java.util.LinkedHashMap;
22 import java.util.List;
23
24 import org.apache.commons.lang.builder.EqualsBuilder;
25 import org.apache.log4j.Logger;
26 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
27
28
29
30
31
32
33
34 public class VendorHeader extends PersistableBusinessObjectBase {
35 private static Logger LOG = Logger.getLogger(VendorHeader.class);
36
37 private Integer vendorHeaderGeneratedIdentifier;
38 private String vendorTypeCode;
39 private String vendorTaxNumber;
40 private String vendorTaxTypeCode;
41 private String vendorOwnershipCode;
42 private String vendorOwnershipCategoryCode;
43 private Date vendorFederalWithholdingTaxBeginningDate;
44 private Date vendorFederalWithholdingTaxEndDate;
45 private Boolean vendorW9ReceivedIndicator;
46 private Boolean vendorW8BenReceivedIndicator;
47 private Boolean vendorDebarredIndicator;
48 private Boolean vendorForeignIndicator;
49
50 private VendorType vendorType;
51 private OwnershipType vendorOwnership;
52 private OwnershipCategory vendorOwnershipCategory;
53 private List<VendorSupplierDiversity> vendorSupplierDiversities;
54 private List<VendorTaxChange> vendorTaxChanges;
55
56
57
58
59 public VendorHeader() {
60 vendorSupplierDiversities = new ArrayList<VendorSupplierDiversity>();
61 }
62
63 public Integer getVendorHeaderGeneratedIdentifier() {
64
65 return vendorHeaderGeneratedIdentifier;
66 }
67
68 public void setVendorHeaderGeneratedIdentifier(Integer vendorHeaderGeneratedIdentifier) {
69 this.vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
70 }
71
72 public String getVendorTypeCode() {
73
74 return vendorTypeCode;
75 }
76
77 public void setVendorTypeCode(String vendorTypeCode) {
78 this.vendorTypeCode = vendorTypeCode;
79 }
80
81 public String getVendorTaxNumber() {
82
83 return vendorTaxNumber;
84 }
85
86 public void setVendorTaxNumber(String vendorTaxNumber) {
87 this.vendorTaxNumber = vendorTaxNumber;
88 }
89
90 public String getVendorTaxTypeCode() {
91
92 return vendorTaxTypeCode;
93 }
94
95 public void setVendorTaxTypeCode(String vendorTaxTypeCode) {
96 this.vendorTaxTypeCode = vendorTaxTypeCode;
97 }
98
99 public String getVendorOwnershipCode() {
100
101 return vendorOwnershipCode;
102 }
103
104 public void setVendorOwnershipCode(String vendorOwnershipCode) {
105 this.vendorOwnershipCode = vendorOwnershipCode;
106 }
107
108 public String getVendorOwnershipCategoryCode() {
109
110 return vendorOwnershipCategoryCode;
111 }
112
113 public void setVendorOwnershipCategoryCode(String vendorOwnershipCategoryCode) {
114 this.vendorOwnershipCategoryCode = vendorOwnershipCategoryCode;
115 }
116
117 public Date getVendorFederalWithholdingTaxBeginningDate() {
118
119 return vendorFederalWithholdingTaxBeginningDate;
120 }
121
122 public void setVendorFederalWithholdingTaxBeginningDate(Date vendorFederalWithholdingTaxBeginningDate) {
123 this.vendorFederalWithholdingTaxBeginningDate = vendorFederalWithholdingTaxBeginningDate;
124 }
125
126 public Date getVendorFederalWithholdingTaxEndDate() {
127
128 return vendorFederalWithholdingTaxEndDate;
129 }
130
131 public void setVendorFederalWithholdingTaxEndDate(Date vendorFederalWithholdingTaxEndDate) {
132 this.vendorFederalWithholdingTaxEndDate = vendorFederalWithholdingTaxEndDate;
133 }
134
135 public Boolean getVendorW9ReceivedIndicator() {
136
137 return vendorW9ReceivedIndicator;
138 }
139
140 public void setVendorW9ReceivedIndicator(Boolean vendorW9ReceivedIndicator) {
141 this.vendorW9ReceivedIndicator = vendorW9ReceivedIndicator;
142 }
143
144 public Boolean getVendorW8BenReceivedIndicator() {
145
146 return vendorW8BenReceivedIndicator;
147 }
148
149 public void setVendorW8BenReceivedIndicator(Boolean vendorW8BenReceivedIndicator) {
150 this.vendorW8BenReceivedIndicator = vendorW8BenReceivedIndicator;
151 }
152
153 public VendorType getVendorType() {
154
155 if (vendorType == null)
156 this.refreshReferenceObject("vendorType");
157 return vendorType;
158 }
159
160
161
162
163
164
165
166 public void setVendorType(VendorType vendorType) {
167 this.vendorType = vendorType;
168 }
169
170 public OwnershipType getVendorOwnership() {
171
172 return vendorOwnership;
173 }
174
175
176
177
178
179
180
181 public void setVendorOwnership(OwnershipType vendorOwnership) {
182 this.vendorOwnership = vendorOwnership;
183 }
184
185 public OwnershipCategory getVendorOwnershipCategory() {
186
187 return vendorOwnershipCategory;
188 }
189
190
191
192
193
194
195
196 public void setVendorOwnershipCategory(OwnershipCategory vendorOwnershipCategory) {
197 this.vendorOwnershipCategory = vendorOwnershipCategory;
198 }
199
200 public Boolean getVendorDebarredIndicator() {
201
202 return vendorDebarredIndicator;
203 }
204
205
206
207
208
209
210 public void setVendorDebarredIndicator(Boolean vendorDebarredIndicator) {
211 this.vendorDebarredIndicator = vendorDebarredIndicator;
212 }
213
214 public Boolean getVendorForeignIndicator() {
215
216 return vendorForeignIndicator;
217 }
218
219
220
221
222
223
224 public void setVendorForeignIndicator(Boolean vendorForeignIndicator) {
225 this.vendorForeignIndicator = vendorForeignIndicator;
226 }
227
228 public List<VendorSupplierDiversity> getVendorSupplierDiversities() {
229
230 return vendorSupplierDiversities;
231 }
232
233 public void setVendorSupplierDiversities(List<VendorSupplierDiversity> vendorSupplierDiversities) {
234 this.vendorSupplierDiversities = vendorSupplierDiversities;
235 }
236
237
238
239
240
241
242
243
244 public String getVendorSupplierDiversitiesAsString() {
245 StringBuilder sb = new StringBuilder("vendorSupplierDiversities=[");
246
247 boolean first = true;
248 for (VendorSupplierDiversity vsd : vendorSupplierDiversities) {
249 if(vsd.isActive()){
250 if (!first) {
251 sb.append(", ");
252 } else {
253 first = false;
254 }
255 sb.append(vsd.getVendorSupplierDiversity().getVendorSupplierDiversityDescription().toString());
256 }
257 }
258 sb.append(']');
259
260 return sb.toString();
261 }
262
263 public List<VendorTaxChange> getVendorTaxChanges() {
264
265 return vendorTaxChanges;
266 }
267
268 public void setVendorTaxChanges(List<VendorTaxChange> vendorTaxChanges) {
269 this.vendorTaxChanges = vendorTaxChanges;
270 }
271
272
273
274
275
276
277
278
279 public boolean isEqualForRouting(Object toCompare) {
280 LOG.debug("Entering isEqualForRouting.");
281 if (!(toCompare instanceof VendorHeader)) {
282 return false;
283 }
284 else {
285 VendorHeader vh = (VendorHeader) toCompare;
286 return new EqualsBuilder().append(this.getVendorTypeCode(), vh.getVendorTypeCode()).append(this.getVendorTaxNumber(), vh.getVendorTaxNumber()).append(this.getVendorOwnershipCode(), vh.getVendorOwnershipCode()).append(this.getVendorOwnershipCategoryCode(), vh.getVendorOwnershipCategoryCode()).append(this.getVendorFederalWithholdingTaxBeginningDate(), vh.getVendorFederalWithholdingTaxBeginningDate()).append(this.getVendorFederalWithholdingTaxEndDate(), vh.getVendorFederalWithholdingTaxEndDate()).append(this.getVendorW9ReceivedIndicator(), vh.getVendorW9ReceivedIndicator()).append(this.getVendorW8BenReceivedIndicator(), vh.getVendorW8BenReceivedIndicator()).append(this.getVendorDebarredIndicator(), vh.getVendorDebarredIndicator()).append(this.getVendorForeignIndicator(), vh.getVendorForeignIndicator()).isEquals();
287 }
288 }
289
290
291
292
293 protected LinkedHashMap toStringMapper_RICE20_REFACTORME() {
294 LinkedHashMap<String, String> m = new LinkedHashMap<String, String>();
295 if (this.vendorHeaderGeneratedIdentifier != null) {
296 m.put("vendorHeaderGeneratedIdentifier", this.vendorHeaderGeneratedIdentifier.toString());
297 }
298 return m;
299 }
300 }