1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.financial.bo;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.apache.log4j.Logger;
20 import org.kuali.rice.core.api.util.type.KualiDecimal;
21 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
22 import org.kuali.rice.krad.util.ObjectUtils;
23
24 import java.sql.Date;
25 import java.util.ArrayList;
26 import java.util.List;
27
28
29
30
31
32
33 public class VendorDetail extends PersistableBusinessObjectBase {
34 private static Logger LOG = Logger.getLogger(VendorDetail.class);
35
36 private Integer vendorHeaderGeneratedIdentifier;
37 private Integer vendorDetailAssignedIdentifier;
38 private String vendorNumber;
39 private boolean vendorParentIndicator;
40 private String vendorName;
41 private String vendorFirstName;
42 private String vendorLastName;
43 private String vendorStateForLookup;
44
45 private boolean activeIndicator;
46 private String vendorInactiveReasonCode;
47 private String vendorDunsNumber;
48 private String vendorPaymentTermsCode;
49 private String vendorShippingTitleCode;
50 private String vendorShippingPaymentTermsCode;
51 private Boolean vendorConfirmationIndicator;
52 private Boolean vendorPrepaymentIndicator;
53 private Boolean vendorCreditCardIndicator;
54 private KualiDecimal vendorMinimumOrderAmount;
55 private String vendorUrlAddress;
56 private String vendorRemitName;
57 private Boolean vendorRestrictedIndicator;
58 private String vendorRestrictedReasonText;
59 private Date vendorRestrictedDate;
60
61 private String vendorSoldToNumber;
62 private Integer vendorSoldToGeneratedIdentifier;
63 private Integer vendorSoldToAssignedIdentifier;
64 private String vendorSoldToName;
65 private boolean vendorFirstLastNameIndicator;
66 private boolean taxableIndicator;
67
68 private List<VendorAddress> vendorAddresses;
69
70
71
72
73
74
75
76
77 private VendorHeader vendorHeader;
78
79 private PaymentTermType vendorPaymentTerms;
80
81 private ShippingPaymentTerms vendorShippingPaymentTerms;
82 private VendorDetail soldToVendorDetail;
83
84
85 private String vendorParentName;
86 private String defaultAddressLine1;
87 private String defaultAddressLine2;
88 private String defaultAddressCity;
89 private String defaultAddressStateCode;
90 private String defaultAddressInternationalProvince;
91 private String defaultAddressPostalCode;
92 private String defaultAddressCountryCode;
93 private String defaultFaxNumber;
94
95
96
97
98 public VendorDetail() {
99 super();
100
101 vendorHeader = new VendorHeader();
102 vendorAddresses = new ArrayList();
103
104
105
106
107
108
109
110 vendorParentIndicator = true;
111
112 }
113
114 public Integer getVendorHeaderGeneratedIdentifier() {
115 return vendorHeaderGeneratedIdentifier;
116 }
117
118 public void setVendorHeaderGeneratedIdentifier(Integer vendorHeaderGeneratedIdentifier) {
119 this.vendorHeaderGeneratedIdentifier = vendorHeaderGeneratedIdentifier;
120 }
121
122 public Integer getVendorDetailAssignedIdentifier() {
123 return vendorDetailAssignedIdentifier;
124 }
125
126 public void setVendorDetailAssignedIdentifier(Integer vendorDetailAssignedIdentifier) {
127 this.vendorDetailAssignedIdentifier = vendorDetailAssignedIdentifier;
128 }
129
130
131
132
133
134
135 public String getVendorNumber() {
136 String headerId = "";
137 String detailId = "";
138 String vendorNumber = "";
139 if (ObjectUtils.isNotNull(this.vendorHeaderGeneratedIdentifier)) {
140 headerId = this.vendorHeaderGeneratedIdentifier.toString();
141 }
142 if (ObjectUtils.isNotNull(this.vendorDetailAssignedIdentifier)) {
143 detailId = this.vendorDetailAssignedIdentifier.toString();
144 }
145 if (!StringUtils.isEmpty(headerId) && !StringUtils.isEmpty(detailId)) {
146 vendorNumber = headerId + "-" + detailId;
147 }
148
149 return vendorNumber;
150 }
151
152
153
154
155
156
157
158
159 public void setVendorNumber(String vendorNumber) {
160 this.vendorNumber = vendorNumber;
161
162 if (StringUtils.isEmpty(vendorNumber)) {
163 vendorHeaderGeneratedIdentifier = null;
164 vendorDetailAssignedIdentifier = null;
165 return;
166 }
167
168 int dashInd = vendorNumber.indexOf('-');
169
170 if (dashInd > 0 && dashInd < vendorNumber.length() - 1) {
171 try {
172 vendorHeaderGeneratedIdentifier = new Integer(vendorNumber.substring(0, dashInd));
173 vendorDetailAssignedIdentifier = new Integer(vendorNumber.substring(dashInd + 1));
174 } catch (NumberFormatException e) {
175
176 }
177 }
178 }
179
180 public String getVendorName() {
181 return vendorName;
182 }
183
184 public void setVendorName(String vendorName) {
185 this.vendorName = vendorName;
186 }
187
188 public Integer getVendorSoldToGeneratedIdentifier() {
189 return vendorSoldToGeneratedIdentifier;
190 }
191
192 public void setVendorSoldToGeneratedIdentifier(Integer vendorSoldToGeneratedIdentifier) {
193 this.vendorSoldToGeneratedIdentifier = vendorSoldToGeneratedIdentifier;
194 }
195
196 public Integer getVendorSoldToAssignedIdentifier() {
197 return vendorSoldToAssignedIdentifier;
198 }
199
200 public void setVendorSoldToAssignedIdentifier(Integer vendorSoldToAssignedIdentifier) {
201 this.vendorSoldToAssignedIdentifier = vendorSoldToAssignedIdentifier;
202 }
203
204
205
206
207
208
209 public String getVendorSoldToNumber() {
210 String headerId = "";
211 String detailId = "";
212 String vendorSoldToNumber = "";
213
214 if (this.vendorSoldToGeneratedIdentifier != null) {
215 headerId = this.vendorSoldToGeneratedIdentifier.toString();
216 }
217 if (this.vendorSoldToAssignedIdentifier != null) {
218 detailId = this.vendorSoldToAssignedIdentifier.toString();
219 }
220 if (!StringUtils.isEmpty(headerId) && !StringUtils.isEmpty(detailId)) {
221 vendorSoldToNumber = headerId + "-" + detailId;
222 }
223
224 return vendorSoldToNumber;
225 }
226
227
228
229
230
231
232
233
234 public void setVendorSoldToNumber(String vendorSoldToNumber) {
235 this.vendorSoldToNumber = vendorSoldToNumber;
236
237 if (StringUtils.isEmpty(vendorSoldToNumber)) {
238 vendorSoldToGeneratedIdentifier = null;
239 vendorSoldToAssignedIdentifier = null;
240 return;
241 }
242
243 int dashInd = vendorSoldToNumber.indexOf('-');
244
245 if (dashInd > 0 && dashInd < vendorSoldToNumber.length() - 1) {
246 try {
247 vendorSoldToGeneratedIdentifier = new Integer(vendorSoldToNumber.substring(0, dashInd));
248 vendorSoldToAssignedIdentifier = new Integer(vendorSoldToNumber.substring(dashInd + 1));
249 } catch (NumberFormatException e) {
250
251 }
252 }
253 }
254
255
256
257
258
259
260 public String getVendorSoldToName() {
261 return this.vendorSoldToName;
262 }
263
264 public void setVendorSoldToName(String vendorSoldToName) {
265 this.vendorSoldToName = vendorSoldToName;
266 }
267
268 public String getAltVendorName() {
269 return vendorName;
270 }
271
272 public void setAltVendorName(String altVendorName) {
273 this.vendorName = altVendorName;
274 }
275
276 public String getVendorRemitName() {
277 return vendorRemitName;
278 }
279
280 public void setVendorRemitName(String vendorRemitName) {
281 this.vendorRemitName = vendorRemitName;
282 }
283
284 public boolean isVendorParentIndicator() {
285 return vendorParentIndicator;
286 }
287
288 public void setVendorParentIndicator(boolean vendorParentIndicator) {
289 this.vendorParentIndicator = vendorParentIndicator;
290 }
291
292 public boolean isTaxableIndicator() {
293 return taxableIndicator;
294 }
295
296 public void setTaxableIndicator(boolean taxableIndicator) {
297 this.taxableIndicator = taxableIndicator;
298 }
299
300 public boolean isVendorDebarred() {
301 return (ObjectUtils.isNotNull(getVendorHeader().getVendorDebarredIndicator()) && getVendorHeader().getVendorDebarredIndicator());
302 }
303
304 public boolean isActiveIndicator() {
305 return activeIndicator;
306 }
307
308 public void setActiveIndicator(boolean activeIndicator) {
309 this.activeIndicator = activeIndicator;
310 }
311
312
313
314
315
316
317
318
319
320 public String getVendorPaymentTermsCode() {
321 return vendorPaymentTermsCode;
322 }
323
324 public void setVendorPaymentTermsCode(String vendorPaymentTermsCode) {
325 this.vendorPaymentTermsCode = vendorPaymentTermsCode;
326 }
327
328
329
330
331
332
333
334
335
336 public String getVendorShippingPaymentTermsCode() {
337 return vendorShippingPaymentTermsCode;
338 }
339
340 public void setVendorShippingPaymentTermsCode(String vendorShippingPaymentTermsCode) {
341 this.vendorShippingPaymentTermsCode = vendorShippingPaymentTermsCode;
342 }
343
344 public Boolean getVendorConfirmationIndicator() {
345 return vendorConfirmationIndicator;
346 }
347
348 public void setVendorConfirmationIndicator(Boolean vendorConfirmationIndicator) {
349 this.vendorConfirmationIndicator = vendorConfirmationIndicator;
350 }
351
352 public Boolean getVendorPrepaymentIndicator() {
353 return vendorPrepaymentIndicator;
354 }
355
356 public void setVendorPrepaymentIndicator(Boolean vendorPrepaymentIndicator) {
357 this.vendorPrepaymentIndicator = vendorPrepaymentIndicator;
358 }
359
360 public Boolean getVendorCreditCardIndicator() {
361 return vendorCreditCardIndicator;
362 }
363
364 public void setVendorCreditCardIndicator(Boolean vendorCreditCardIndicator) {
365 this.vendorCreditCardIndicator = vendorCreditCardIndicator;
366 }
367
368 public KualiDecimal getVendorMinimumOrderAmount() {
369 return vendorMinimumOrderAmount;
370 }
371
372 public void setVendorMinimumOrderAmount(KualiDecimal vendorMinimumOrderAmount) {
373 this.vendorMinimumOrderAmount = vendorMinimumOrderAmount;
374 }
375
376 public String getVendorUrlAddress() {
377 return vendorUrlAddress;
378 }
379
380 public void setVendorUrlAddress(String vendorUrlAddress) {
381 this.vendorUrlAddress = vendorUrlAddress;
382 }
383
384 public Boolean getVendorRestrictedIndicator() {
385 return vendorRestrictedIndicator;
386 }
387
388 public void setVendorRestrictedIndicator(Boolean vendorRestrictedIndicator) {
389 this.vendorRestrictedIndicator = vendorRestrictedIndicator;
390 }
391
392 public String getVendorRestrictedReasonText() {
393 return vendorRestrictedReasonText;
394 }
395
396 public void setVendorRestrictedReasonText(String vendorRestrictedReasonText) {
397 this.vendorRestrictedReasonText = vendorRestrictedReasonText;
398 }
399
400 public Date getVendorRestrictedDate() {
401 return vendorRestrictedDate;
402 }
403
404 public void setVendorRestrictedDate(Date vendorRestrictedDate) {
405 this.vendorRestrictedDate = vendorRestrictedDate;
406 }
407
408
409
410
411
412
413
414
415
416 public String getVendorDunsNumber() {
417 return vendorDunsNumber;
418 }
419
420 public void setVendorDunsNumber(String vendorDunsNumber) {
421 this.vendorDunsNumber = vendorDunsNumber;
422 }
423
424 public VendorHeader getVendorHeader() {
425 return vendorHeader;
426 }
427
428 public void setVendorHeader(VendorHeader vendorHeader) {
429 this.vendorHeader = vendorHeader;
430 }
431
432 public PaymentTermType getVendorPaymentTerms() {
433 return vendorPaymentTerms;
434 }
435
436
437
438
439
440
441
442 public void setVendorPaymentTerms(PaymentTermType vendorPaymentTerms) {
443 this.vendorPaymentTerms = vendorPaymentTerms;
444 }
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459 public ShippingPaymentTerms getVendorShippingPaymentTerms() {
460 return vendorShippingPaymentTerms;
461 }
462
463
464
465
466
467
468
469 public void setVendorShippingPaymentTerms(ShippingPaymentTerms vendorShippingPaymentTerms) {
470 this.vendorShippingPaymentTerms = vendorShippingPaymentTerms;
471 }
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486 public List<VendorAddress> getVendorAddresses() {
487 return vendorAddresses;
488 }
489
490 public void setVendorAddresses(List<VendorAddress> vendorAddresses) {
491 this.vendorAddresses = vendorAddresses;
492 }
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550 public String getVendorFirstName() {
551 return vendorFirstName;
552 }
553
554 public void setVendorFirstName(String vendorFirstName) {
555 this.vendorFirstName = vendorFirstName;
556 }
557
558 public String getVendorLastName() {
559 return vendorLastName;
560 }
561
562 public void setVendorLastName(String vendorLastName) {
563 this.vendorLastName = vendorLastName;
564 }
565
566 public VendorDetail getSoldToVendorDetail() {
567 return soldToVendorDetail;
568 }
569
570 public void setSoldToVendorDetail(VendorDetail soldToVendorDetail) {
571 this.soldToVendorDetail = soldToVendorDetail;
572 }
573
574 public boolean isVendorFirstLastNameIndicator() {
575 return vendorFirstLastNameIndicator;
576 }
577
578 public void setVendorFirstLastNameIndicator(boolean vendorFirstLastNameIndicator) {
579 this.vendorFirstLastNameIndicator = vendorFirstLastNameIndicator;
580 }
581
582 public String getVendorStateForLookup() {
583 return vendorStateForLookup;
584 }
585
586 public void setVendorStateForLookup(String vendorStateForLookup) {
587 this.vendorStateForLookup = vendorStateForLookup;
588 }
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604 public String getDefaultAddressLine1() {
605 return defaultAddressLine1;
606 }
607
608 public void setDefaultAddressLine1(String defaultAddressLine1) {
609 this.defaultAddressLine1 = defaultAddressLine1;
610 }
611
612 public String getDefaultAddressCity() {
613 return defaultAddressCity;
614 }
615
616 public void setDefaultAddressCity(String defaultAddressCity) {
617 this.defaultAddressCity = defaultAddressCity;
618 }
619
620 public String getDefaultAddressLine2() {
621 return defaultAddressLine2;
622 }
623
624 public void setDefaultAddressLine2(String defaultAddressLine2) {
625 this.defaultAddressLine2 = defaultAddressLine2;
626 }
627
628 public String getDefaultAddressPostalCode() {
629 return defaultAddressPostalCode;
630 }
631
632 public void setDefaultAddressPostalCode(String defaultAddressPostalCode) {
633 this.defaultAddressPostalCode = defaultAddressPostalCode;
634 }
635
636 public String getDefaultAddressStateCode() {
637 return defaultAddressStateCode;
638 }
639
640 public void setDefaultAddressStateCode(String defaultAddressStateCode) {
641 this.defaultAddressStateCode = defaultAddressStateCode;
642 }
643
644 public String getDefaultAddressInternationalProvince() {
645 return defaultAddressInternationalProvince;
646 }
647
648 public void setDefaultAddressInternationalProvince(String defaultAddressInternationalProvince) {
649 this.defaultAddressInternationalProvince = defaultAddressInternationalProvince;
650 }
651
652 public String getDefaultAddressCountryCode() {
653 return defaultAddressCountryCode;
654 }
655
656 public void setDefaultAddressCountryCode(String defaultAddressCountryCode) {
657 this.defaultAddressCountryCode = defaultAddressCountryCode;
658 }
659
660 public String getDefaultFaxNumber() {
661 return defaultFaxNumber;
662 }
663
664 public void setDefaultFaxNumber(String defaultFaxNumber) {
665 this.defaultFaxNumber = defaultFaxNumber;
666 }
667
668 public void setVendorParentName(String vendorParentName) {
669 this.vendorParentName = vendorParentName;
670 }
671
672
673 public String getVendorInactiveReasonCode() {
674 return this.vendorInactiveReasonCode;
675 }
676
677 public void setVendorInactiveReasonCode(String vendorInactiveReasonCode) {
678 this.vendorInactiveReasonCode = vendorInactiveReasonCode;
679 }
680
681 public String getVendorShippingTitleCode() {
682 return this.vendorShippingTitleCode;
683 }
684
685 public void setVendorShippingTitleCode(String vendorShippingTitleCode) {
686 this.vendorShippingTitleCode = vendorShippingTitleCode;
687 }
688
689 public String getVendorParentName() {
690 return this.vendorParentName;
691 }
692
693
694 }
695