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