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