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