001/*
002 * Copyright 2007 The Kuali Foundation
003 * 
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 * 
008 * http://www.opensource.org/licenses/ecl2.php
009 * 
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016/*
017 * Created on Jul 5, 2004
018 *
019 */
020package org.kuali.ole.pdp.businessobject;
021
022import java.util.ArrayList;
023import java.util.HashMap;
024import java.util.List;
025import java.util.Map;
026
027import org.apache.commons.lang.StringUtils;
028import org.apache.commons.lang.builder.EqualsBuilder;
029import org.apache.commons.lang.builder.HashCodeBuilder;
030import org.apache.commons.lang.builder.ToStringBuilder;
031import org.kuali.ole.coa.businessobject.Account;
032import org.kuali.ole.coa.businessobject.Chart;
033import org.kuali.ole.coa.businessobject.ObjectCode;
034import org.kuali.ole.coa.businessobject.SubAccount;
035import org.kuali.ole.coa.businessobject.SubObjectCode;
036import org.kuali.ole.sys.OLEConstants;
037import org.kuali.ole.sys.context.SpringContext;
038import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
039import org.kuali.rice.core.api.util.type.KualiDecimal;
040import org.kuali.rice.core.api.util.type.KualiInteger;
041import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
042import org.kuali.rice.krad.service.KualiModuleService;
043import org.kuali.rice.krad.service.ModuleService;
044import org.kuali.rice.location.api.LocationConstants;
045import org.kuali.rice.location.framework.campus.CampusEbo;
046import org.kuali.rice.location.framework.country.CountryEbo;
047import org.kuali.rice.location.framework.postalcode.PostalCodeEbo;
048import org.kuali.rice.location.framework.state.StateEbo;
049
050public class CustomerProfile extends PersistableBusinessObjectBase implements MutableInactivatable {
051    private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(CustomerProfile.class);
052
053    protected String achPaymentDescription; // ACH_PMT_DESC
054    protected String additionalCheckNoteTextLine1;
055    protected String additionalCheckNoteTextLine2;
056    protected String additionalCheckNoteTextLine3;
057    protected String additionalCheckNoteTextLine4;
058    protected String address1; // CUST_LN1_ADDR
059    protected String address2; // CUST_LN2_ADDR
060    protected String address3; // CUST_LN3_ADDR
061    protected String address4; // CUST_LN4_ADDR
062    protected boolean adviceCreate; // ADV_CRTE_IND
063    protected String adviceHeaderText; // ADV_HDR_TXT
064    protected String adviceSubjectLine;
065    protected String adviceReturnEmailAddr;
066    protected String chartCode; // FIN_COA_CD
067    protected String checkHeaderNoteTextLine1;
068    protected String checkHeaderNoteTextLine2;
069    protected String checkHeaderNoteTextLine3;
070    protected String checkHeaderNoteTextLine4;
071    protected String city; // CUST_CTY_NM
072    protected String contactFullName; // CUST_CNTC_FULL_NM
073    protected String countryCode; // CUST_CNTRY_NM
074    protected String customerDescription; // CUST_DESC
075    protected String defaultChartCode; // DFLT_COA_CD
076    protected String defaultAccountNumber; // DFLT_ACCT_NBR
077    protected String defaultSubAccountNumber; // DFLT_SUB_ACCT_NBR
078    protected String defaultObjectCode; // DFLT_OBJ_CD
079    protected String defaultPhysicalCampusProcessingCode; // DFLT_PHYS_CMP_PROC_CD
080    protected String defaultSubObjectCode; // DFLT_SUB_OBJ_CD
081    protected boolean employeeCheck; // CUST_EMP_CHK_IND
082    protected KualiDecimal fileThresholdAmount; // FL_THRSHLD_AMT
083    protected String fileThresholdEmailAddress; // CUST_FILE_THRSHLD_EMAIL_ADDR
084    protected KualiInteger id; // CUST_ID
085    protected boolean nraReview; // CUST_NRA_RVW_IND
086    protected String unitCode; // ORG_CD
087    protected boolean ownershipCodeRequired; // CUST_OWNR_CD_REQ_IND
088    protected boolean payeeIdRequired; // CUST_PAYEE_ID_REQ_IND
089    protected KualiDecimal paymentThresholdAmount; // PMT_THRSHLD_AMT
090    protected String paymentThresholdEmailAddress; // CUST_PMT_THRSHLD_EMAIL_ADDR
091    protected String processingEmailAddr; // CUST_PRCS_EMAIL_ADDR
092    protected String achTransactionType;
093    protected String stateCode; // CUST_ST_CD
094    protected String subUnitCode; // SBUNT_CD
095    protected String zipCode; // CUST_ZIP_CD
096    protected boolean accountingEditRequired; // ACCTG_EDIT_REQ_IND
097    protected boolean relieveLiabilities;
098    protected boolean active;
099    protected boolean selectedForFormat;
100
101    protected Chart chartOfAccounts;
102    protected CampusEbo defaultProcessingCampus;
103    protected Chart defaultChart;
104    protected Account defaultAccount;
105    protected SubAccount defaultSubAccount;
106    protected ObjectCode defaultObject;
107    protected SubObjectCode defaultSubObject;
108    protected StateEbo state;
109    protected PostalCodeEbo postalCode;
110    protected CountryEbo country;
111    protected ACHTransactionType transactionType;
112
113    protected List<CustomerBank> customerBanks;
114
115
116    public CustomerProfile() {
117        super();
118        customerBanks = new ArrayList<CustomerBank>();;
119    }
120
121    public String getCustomerShortName() {
122        return chartCode + "-" + unitCode + "-" + subUnitCode;
123    }
124
125    public void setCustomerShortName(String customerShortName) {
126        
127    }
128
129    public String getSortName() {
130        return (this.chartCode + this.unitCode + this.subUnitCode);
131    }
132
133    /**
134     * @hibernate.property column="ACCTG_EDIT_REQ_IND" type="yes_no" not-null="true"
135     * @return Returns the accountingEditRequird.
136     */
137    public boolean getAccountingEditRequired() {
138        return accountingEditRequired;
139    }
140
141    /**
142     * @param accountingEditRequird The accountingEditRequird to set.
143     */
144    public void setAccountingEditRequired(boolean accountingEditRequird) {
145        this.accountingEditRequired = accountingEditRequird;
146    }
147
148    /**
149     * @hibernate.property column="DFLT_SUB_ACCT_NBR" length="5" not-null="true"
150     * @return Returns the defaultSubAccountNumber.
151     */
152    public String getDefaultSubAccountNumber() {
153        return defaultSubAccountNumber;
154    }
155
156    /**
157     * @param defaultSubAccountNumber The defaultSubAccountNumber to set.
158     */
159    public void setDefaultSubAccountNumber(String defaultSubAccountNumber) {
160        this.defaultSubAccountNumber = defaultSubAccountNumber;
161    }
162
163    public List<CustomerBank> getCustomerBanks() {
164        return customerBanks;
165    }
166
167    public CustomerBank getCustomerBankByDisbursementType(String dt) {
168        for (CustomerBank element : customerBanks) {
169            if (element.getDisbursementType().getCode().equals(dt)) {
170                return element;
171            }
172        }
173
174        return null;
175    }
176
177    public void setCustomerBanks(List<CustomerBank> cbs) {
178        customerBanks = cbs;
179    }
180
181    @Override
182    public boolean equals(Object obj) {
183        if (!(obj instanceof CustomerProfile)) {
184            return false;
185        }
186        CustomerProfile tc = (CustomerProfile) obj;
187        return new EqualsBuilder().append(chartCode, tc.getChartCode()).append(unitCode, tc.getUnitCode()).append(subUnitCode, tc.getSubUnitCode()).isEquals();
188    }
189
190    /**
191     * @hibernate.property column="ACH_PMT_DESC" length="100" not-null="false"
192     * @return Returns the achPaymentDescription.
193     */
194    public String getAchPaymentDescription() {
195        return achPaymentDescription;
196    }
197
198    /**
199     * @hibernate.property column="ADDL_CHK_NTE_TXT_LN1" length="90" not-null="false"
200     * @return Returns the additionalCheckNoteTextLine1.
201     */
202    public String getAdditionalCheckNoteTextLine1() {
203        return additionalCheckNoteTextLine1;
204    }
205
206    /**
207     * @hibernate.property column="ADDL_CHK_NTE_TXT_LN2" length="90" not-null="false"
208     * @return Returns the additionalCheckNoteTextLine2.
209     */
210    public String getAdditionalCheckNoteTextLine2() {
211        return additionalCheckNoteTextLine2;
212    }
213
214    /**
215     * @hibernate.property column="ADDL_CHK_NTE_LN3_TXT" length="90" not-null="false"
216     * @return Returns the additionalCheckNoteTextLine3.
217     */
218    public String getAdditionalCheckNoteTextLine3() {
219        return additionalCheckNoteTextLine3;
220    }
221
222    /**
223     * @hibernate.property column="ADDL_CHK_NTE_TXT_LN4" length="90" not-null="false"
224     * @return Returns the additionalCheckNoteTextLine4.
225     */
226    public String getAdditionalCheckNoteTextLine4() {
227        return additionalCheckNoteTextLine4;
228    }
229
230    /**
231     * @hibernate.property column="CUST_LN1_ADDR" length="55" not-null="false"
232     * @return Returns the address1.
233     */
234    public String getAddress1() {
235        return address1;
236    }
237
238    /**
239     * @hibernate.property column="CUST_LN2_ADDR" length="55" not-null="false"
240     * @return Returns the address2.
241     */
242    public String getAddress2() {
243        return address2;
244    }
245
246    /**
247     * @hibernate.property column="CUST_LN3_ADDR" length="55" not-null="false"
248     * @return Returns the address3.
249     */
250    public String getAddress3() {
251        return address3;
252    }
253
254    /**
255     * @hibernate.property column="CUST_LN4_ADDR" length="55" not-null="false"
256     * @return Returns the address4.
257     */
258    public String getAddress4() {
259        return address4;
260    }
261
262    /**
263     * @hibernate.property column="ADV_HDR_TXT" length="200" not-null="false"
264     * @return Returns the adviceHeaderText.
265     */
266    public String getAdviceHeaderText() {
267        return adviceHeaderText;
268    }
269
270    /**
271     * @hibernate.property column="FIN_COA_CD" length="2" not-null="true"
272     * @return Returns the chartCode.
273     */
274    public String getChartCode() {
275        return chartCode;
276    }
277
278    /**
279     * @hibernate.property column="CHK_HDR_NTE_TXT_LN1" length="90" not-null="false"
280     * @return Returns the checkHeaderNoteTextLine1.
281     */
282    public String getCheckHeaderNoteTextLine1() {
283        return checkHeaderNoteTextLine1;
284    }
285
286    /**
287     * @hibernate.property column="CHK_HDR_NTE_TXT_LN2" length="90" not-null="false"
288     * @return Returns the checkHeaderNoteTextLine2.
289     */
290    public String getCheckHeaderNoteTextLine2() {
291        return checkHeaderNoteTextLine2;
292    }
293
294    /**
295     * @hibernate.property column="CHK_HDR_NTE_LN3_TXT" length="90" not-null="false"
296     * @return Returns the checkHeaderNoteTextLine3.
297     */
298    public String getCheckHeaderNoteTextLine3() {
299        return checkHeaderNoteTextLine3;
300    }
301
302    /**
303     * @hibernate.property column="CHK_HDR_NTE_TXT_LN4" length="90" not-null="false"
304     * @return Returns the checkHeaderNoteTextLine4.
305     */
306    public String getCheckHeaderNoteTextLine4() {
307        return checkHeaderNoteTextLine4;
308    }
309
310    /**
311     * @hibernate.property column="CUST_CTY_NM" length="30" not-null="false"
312     * @return Returns the city.
313     */
314    public String getCity() {
315        return city;
316    }
317
318    /**
319     * @hibernate.property column="CUST_CNTC_FULL_NM" length="50" not-null="false"
320     * @return Returns the contactFullName.
321     */
322    public String getContactFullName() {
323        return contactFullName;
324    }
325
326
327    /**
328     * @hibernate.property column="CUST_DESC" length="50" not-null="false"
329     * @return Returns the customerDescription.
330     */
331    public String getCustomerDescription() {
332        return customerDescription;
333    }
334
335    /**
336     * @hibernate.property column="DFLT_ACCT_NBR" length="7" not-null="true"
337     * @return Returns the defaultAccountNumber.
338     */
339    public String getDefaultAccountNumber() {
340        return defaultAccountNumber;
341    }
342
343    /**
344     * @hibernate.property column="DFLT_COA_CD" length="2" not-null="true"
345     * @return Returns the defaultChartCode.
346     */
347    public String getDefaultChartCode() {
348        return defaultChartCode;
349    }
350
351    /**
352     * @hibernate.property column="DFLT_OBJ_CD" length="4" not-null="true"
353     * @return Returns the defaultObjectCode.
354     */
355    public String getDefaultObjectCode() {
356        return defaultObjectCode;
357    }
358
359    /**
360     * @hibernate.property column="DFLT_PHYS_CMP_PROC_CD" length="2" not-null="false"
361     * @return Returns the defaultPhysicalCampusProcessingCode.
362     */
363    public String getDefaultPhysicalCampusProcessingCode() {
364        return defaultPhysicalCampusProcessingCode;
365    }
366
367    /**
368     * @hibernate.property column="DFLT_SUB_OBJ_CD" length="3" not-null="true"
369     * @return Returns the defaultSubObjectCode.
370     */
371    public String getDefaultSubObjectCode() {
372        return defaultSubObjectCode;
373    }
374
375    /**
376     * @hibernate.property column="FL_THRSHLD_AMT" not-null="false"
377     * @return Returns the fileThresholdAmount.
378     */
379    public KualiDecimal getFileThresholdAmount() {
380        return fileThresholdAmount;
381    }
382
383    /**
384     * @hibernate.property column="CUST_FILE_THRSHLD_EMAIL_ADDR" length="50" not-null="false"
385     * @return Returns the fileThresholdEmailAddress.
386     */
387    public String getFileThresholdEmailAddress() {
388        return fileThresholdEmailAddress;
389    }
390
391    /**
392     * @return Returns the id.
393     * @hibernate.id column="CUST_ID" generator-class="sequence"
394     * @hibernate.generator-param name="sequence" value="PDP.PDP_CUST_ID_SEQ"
395     */
396    public KualiInteger getId() {
397        return id;
398    }
399
400    /**
401     * @hibernate.property column="ORG_CD" length="4" not-null="true"
402     * @return Returns the unitCode.
403     */
404    public String getUnitCode() {
405        return unitCode;
406    }
407
408    /**
409     * @hibernate.property column="PMT_THRSHLD_AMT" not-null="false"
410     * @return Returns the paymentThresholdAmount.
411     */
412    public KualiDecimal getPaymentThresholdAmount() {
413        return paymentThresholdAmount;
414    }
415
416    /**
417     * @hibernate.property column="CUST_PMT_THRSHLD_EMAIL_ADDR" length="50" not-null="false"
418     * @return Returns the paymentThresholdEmailAddress.
419     */
420    public String getPaymentThresholdEmailAddress() {
421        return paymentThresholdEmailAddress;
422    }
423
424    /**
425     * @hibernate.property column="CUST_PRCS_EMAIL_ADDR" length="50" not-null="false"
426     * @return Returns the processingEmailAddr.
427     */
428    public String getProcessingEmailAddr() {
429        return processingEmailAddr;
430    }
431
432    public String getFirstFiftyProcessingEmailAddr() {
433        if ((processingEmailAddr != null) && (processingEmailAddr.length() > 50)) {
434            return processingEmailAddr.substring(0, 50);
435        }
436        return processingEmailAddr;
437    }
438
439    /**
440     * @hibernate.property column="CUST_ST_CD" length="30" not-null="false"
441     * @return Returns the state.
442     */
443    public String getStateCode() {
444        return stateCode;
445    }
446
447    /**
448     * @hibernate.property column="SBUNT_CD" length="4" not-null="true"
449     * @return Returns the subUnitCode.
450     */
451    public String getSubUnitCode() {
452        return subUnitCode;
453    }
454
455    /**
456     * @hibernate.property column="CUST_ZIP_CD" length="20" not-null="false"
457     * @return Returns the zipCode.
458     */
459    public String getZipCode() {
460        return zipCode;
461    }
462
463    @Override
464    public int hashCode() {
465        return new HashCodeBuilder(59, 67).append(chartCode).append(unitCode).append(subUnitCode).toHashCode();
466    }
467
468    /**
469     * @hibernate.property column="ADV_CRTE_IND" type="yes_no" not-null="false"
470     * @return Returns the adviceCreate.
471     */
472    public boolean getAdviceCreate() {
473        return adviceCreate;
474    }
475
476    /**
477     * @hibernate.property column="ADV_SUBJ_LN_TXT" length="40" not-null="false"
478     * @return Returns the adviceSubjectLine.
479     */
480    public String getAdviceSubjectLine() {
481        return adviceSubjectLine;
482    }
483
484    /**
485     * @hibernate.property column="ADV_RTRN_EMAIL_ADDR" length="50" not-null="false"
486     * @return Returns the adviceReturnEmailAddr.
487     */
488    public String getAdviceReturnEmailAddr() {
489        return adviceReturnEmailAddr;
490    }
491
492    /**
493     * @hibernate.property column="CUST_EMP_CHK_IND" type="yes_no" not-null="false"
494     * @return Returns the employeeCheck.
495     */
496    public boolean getEmployeeCheck() {
497        return employeeCheck;
498    }
499
500    /**
501     * @hibernate.property column="CUST_NRA_RVW_IND" type="yes_no" not-null="false"
502     * @return Returns the nraReview.
503     */
504    public boolean getNraReview() {
505        return nraReview;
506    }
507
508    /**
509     * @hibernate.property column="CUST_OWNR_CD_REQ_IND" type="yes_no" not-null="false"
510     * @return Returns the ownershipCodeRequired.
511     */
512    public boolean getOwnershipCodeRequired() {
513        return ownershipCodeRequired;
514    }
515
516    /**
517     * @hibernate.property column="CUST_PAYEE_ID_REQ_IND" type="yes_no" not-null="false"
518     * @return Returns the payeeIdRequired.
519     */
520    public boolean getPayeeIdRequired() {
521        return payeeIdRequired;
522    }
523
524    /**
525     * @param achPaymentDescription The achPaymentDescription to set.
526     */
527    public void setAchPaymentDescription(String achPaymentDescription) {
528        this.achPaymentDescription = achPaymentDescription;
529    }
530
531    /**
532     * @param additionalCheckNoteTextLine1 The additionalCheckNoteTextLine1 to set.
533     */
534    public void setAdditionalCheckNoteTextLine1(String additionalCheckNoteTextLine1) {
535        this.additionalCheckNoteTextLine1 = additionalCheckNoteTextLine1;
536    }
537
538    /**
539     * @param additionalCheckNoteTextLine2 The additionalCheckNoteTextLine2 to set.
540     */
541    public void setAdditionalCheckNoteTextLine2(String additionalCheckNoteTextLine2) {
542        this.additionalCheckNoteTextLine2 = additionalCheckNoteTextLine2;
543    }
544
545    /**
546     * @param additionalCheckNoteTextLine3 The additionalCheckNoteTexLine3 to set.
547     */
548    public void setAdditionalCheckNoteTextLine3(String additionalCheckNoteTextLine3) {
549        this.additionalCheckNoteTextLine3 = additionalCheckNoteTextLine3;
550    }
551
552    /**
553     * @param additionalCheckNoteTextLine4 The additionalCheckNoteTextLine4 to set.
554     */
555    public void setAdditionalCheckNoteTextLine4(String additionalCheckNoteTextLine4) {
556        this.additionalCheckNoteTextLine4 = additionalCheckNoteTextLine4;
557    }
558
559    /**
560     * @param address1 The address1 to set.
561     */
562    public void setAddress1(String address1) {
563        this.address1 = address1;
564    }
565
566    /**
567     * @param address2 The address2 to set.
568     */
569    public void setAddress2(String address2) {
570        this.address2 = address2;
571    }
572
573    /**
574     * @param address3 The address3 to set.
575     */
576    public void setAddress3(String address3) {
577        this.address3 = address3;
578    }
579
580    /**
581     * @param address4 The address4 to set.
582     */
583    public void setAddress4(String address4) {
584        this.address4 = address4;
585    }
586
587    /**
588     * @param adviceCreate The adviceCreate to set.
589     */
590    public void setAdviceCreate(boolean adviceCreate) {
591        this.adviceCreate = adviceCreate;
592    }
593
594    /**
595     * @param adviceHeaderText The adviceHeaderText to set.
596     */
597    public void setAdviceHeaderText(String adviceHeaderText) {
598        this.adviceHeaderText = adviceHeaderText;
599    }
600
601    /**
602     * @param adviceSubjectLine The adviceSubjectLine to set.
603     */
604    public void setAdviceSubjectLine(String adviceSubjectLine) {
605        this.adviceSubjectLine = adviceSubjectLine;
606    }
607
608    /**
609     * @param adviceReturnEmailAddr The adviceReturnEmailAddr to set.
610     */
611    public void setAdviceReturnEmailAddr(String adviceReturnEmailAddr) {
612        this.adviceReturnEmailAddr = adviceReturnEmailAddr;
613    }
614
615    /**
616     * @param chartCode The chartCode to set.
617     */
618    public void setChartCode(String chartCode) {
619        this.chartCode = chartCode;
620    }
621
622    /**
623     * @param checkHeaderNoteTextLine1 The checkHeaderNoteTextLine1 to set.
624     */
625    public void setCheckHeaderNoteTextLine1(String checkHeaderNoteTextLine1) {
626        this.checkHeaderNoteTextLine1 = checkHeaderNoteTextLine1;
627    }
628
629    /**
630     * @param checkHeaderNoteTextLine2 The checkHeaderNoteTextLine2 to set.
631     */
632    public void setCheckHeaderNoteTextLine2(String checkHeaderNoteTextLine2) {
633        this.checkHeaderNoteTextLine2 = checkHeaderNoteTextLine2;
634    }
635
636    /**
637     * @param checkHeaderNoteTextLine3 The checkHeaderNoteTextLine3 to set.
638     */
639    public void setCheckHeaderNoteTextLine3(String checkHeaderNoteTextLine3) {
640        this.checkHeaderNoteTextLine3 = checkHeaderNoteTextLine3;
641    }
642
643    /**
644     * @param checkHeaderNoteTextLine4 The checkHeaderNoteTextLine4 to set.
645     */
646    public void setCheckHeaderNoteTextLine4(String checkHeaderNoteTextLine4) {
647        this.checkHeaderNoteTextLine4 = checkHeaderNoteTextLine4;
648    }
649
650    /**
651     * @param city The city to set.
652     */
653    public void setCity(String city) {
654        this.city = city;
655    }
656
657    /**
658     * @param contactFullName The contactFullName to set.
659     */
660    public void setContactFullName(String contactFullName) {
661        this.contactFullName = contactFullName;
662    }
663
664    /**
665     * @param customerDescription The customerDescription to set.
666     */
667    public void setCustomerDescription(String customerDescription) {
668        this.customerDescription = customerDescription;
669    }
670
671    /**
672     * @param defaultAccountNumber The defaultAccountNumber to set.
673     */
674    public void setDefaultAccountNumber(String defaultAccountNumber) {
675        this.defaultAccountNumber = defaultAccountNumber;
676    }
677
678    /**
679     * @param defaultChartCode The defaultChartCode to set.
680     */
681    public void setDefaultChartCode(String defaultChartCode) {
682        this.defaultChartCode = defaultChartCode;
683    }
684
685    /**
686     * @param defaultObjectCode The defaultObjectCode to set.
687     */
688    public void setDefaultObjectCode(String defaultObjectCode) {
689        this.defaultObjectCode = defaultObjectCode;
690    }
691
692    /**
693     * @param defaultPhysicalCampusProcessingCode The defaultPhysicalCampusProcessingCode to set.
694     */
695    public void setDefaultPhysicalCampusProcessingCode(String defaultPhysicalCampusProcessingCode) {
696        this.defaultPhysicalCampusProcessingCode = defaultPhysicalCampusProcessingCode;
697    }
698
699    /**
700     * @param defaultSubObjectCode The defaultSubObjectCode to set.
701     */
702    public void setDefaultSubObjectCode(String defaultSubObjectCode) {
703        this.defaultSubObjectCode = defaultSubObjectCode;
704    }
705
706    /**
707     * @param employeeCheck The employeeCheck to set.
708     */
709    public void setEmployeeCheck(boolean employeeCheck) {
710        this.employeeCheck = employeeCheck;
711    }
712
713    /**
714     * @param fileThresholdAmount The fileThresholdAmount to set.
715     */
716    public void setFileThresholdAmount(KualiDecimal fileThresholdAmount) {
717        this.fileThresholdAmount = fileThresholdAmount;
718    }
719
720    /**
721     * @param fileThresholdEmailAddress The fileThresholdEmailAddress to set.
722     */
723    public void setFileThresholdEmailAddress(String fileThresholdEmailAddress) {
724        this.fileThresholdEmailAddress = fileThresholdEmailAddress;
725    }
726
727    /**
728     * @param id The id to set.
729     */
730    public void setId(KualiInteger id) {
731        this.id = id;
732    }
733
734    /**
735     * @param nraReview The nraReview to set.
736     */
737    public void setNraReview(boolean nraReview) {
738        this.nraReview = nraReview;
739    }
740
741    /**
742     * @param unitCode The unitCode to set.
743     */
744    public void setUnitCode(String orgCode) {
745        this.unitCode = orgCode;
746    }
747
748    /**
749     * @param ownershipCodeRequired The ownershipCodeRequired to set.
750     */
751    public void setOwnershipCodeRequired(boolean ownershipCodeRequired) {
752        this.ownershipCodeRequired = ownershipCodeRequired;
753    }
754
755    /**
756     * @param payeeIdRequired The payeeIdRequired to set.
757     */
758    public void setPayeeIdRequired(boolean payeeIdRequired) {
759        this.payeeIdRequired = payeeIdRequired;
760    }
761
762    /**
763     * @param paymentThresholdAmount The paymentThresholdAmount to set.
764     */
765    public void setPaymentThresholdAmount(KualiDecimal paymentThresholdAmount) {
766        this.paymentThresholdAmount = paymentThresholdAmount;
767    }
768
769    /**
770     * @param paymentThresholdEmailAddress The paymentThresholdEmailAddress to set.
771     */
772    public void setPaymentThresholdEmailAddress(String paymentThresholdEmailAddress) {
773        this.paymentThresholdEmailAddress = paymentThresholdEmailAddress;
774    }
775
776    /**
777     * @param processingEmailAddr The processingEmailAddr to set.
778     */
779    public void setProcessingEmailAddr(String processingEmailAddr) {
780        this.processingEmailAddr = processingEmailAddr;
781    }
782
783    /**
784     * @param state The state to set.
785     */
786    public void setStateCode(String state) {
787        this.stateCode = state;
788    }
789
790    /**
791     * @param subUnitCode The subUnitCode to set.
792     */
793    public void setSubUnitCode(String subUnitCode) {
794        this.subUnitCode = subUnitCode;
795    }
796
797    /**
798     * @param zipCode The zipCode to set.
799     */
800    public void setZipCode(String zipCode) {
801        this.zipCode = zipCode;
802    }
803
804    /**
805     * @return Returns the relieveLiabilities.
806     */
807    public boolean getRelieveLiabilities() {
808        return relieveLiabilities;
809    }
810
811    /**
812     * @param relieveLiabilities The relieveLiabilities to set.
813     */
814    public void setRelieveLiabilities(boolean relieveLiabilities) {
815        this.relieveLiabilities = relieveLiabilities;
816    }
817
818    @Override
819    public String toString() {
820        return new ToStringBuilder(this).append("chartCode", this.chartCode).append("unitCode", this.unitCode).append("subUnitCode", this.subUnitCode).toString();
821    }
822
823    public Chart getChartOfAccounts() {
824        return chartOfAccounts;
825    }
826
827    public void setChartOfAccounts(Chart chartOfAccounts) {
828        this.chartOfAccounts = chartOfAccounts;
829    }
830
831
832    /**
833     * Gets the defaultProcessingCampus attribute.
834     * 
835     * @return Returns the defaultProcessingCampus.
836     */
837    public CampusEbo getDefaultProcessingCampus() {
838        if ( StringUtils.isBlank(defaultPhysicalCampusProcessingCode) ) {
839            defaultProcessingCampus = null;
840        } else {
841            if ( defaultProcessingCampus == null || !StringUtils.equals( defaultProcessingCampus.getCode(),defaultPhysicalCampusProcessingCode) ) {
842                ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CampusEbo.class);
843                if ( moduleService != null ) {
844                    Map<String,Object> keys = new HashMap<String, Object>(1);
845                    keys.put(LocationConstants.PrimaryKeyConstants.CODE, defaultPhysicalCampusProcessingCode);
846                    defaultProcessingCampus = moduleService.getExternalizableBusinessObject(CampusEbo.class, keys);
847                } else {
848                    throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed." );
849                }
850            }
851        }
852        return defaultProcessingCampus;
853    }
854
855    /**
856     * Sets the defaultProcessingCampus attribute value.
857     * 
858     * @param defaultProcessingCampus The defaultProcessingCampus to set.
859     */
860    public void setDefaultProcessingCampus(CampusEbo defaultProcessingCampus) {
861        this.defaultProcessingCampus = defaultProcessingCampus;
862    }
863
864    /**
865     * Gets the defaultChart attribute.
866     * 
867     * @return Returns the defaultChart.
868     */
869    public Chart getDefaultChart() {
870        return defaultChart;
871    }
872
873    /**
874     * Sets the defaultChart attribute value.
875     * 
876     * @param defaultChart The defaultChart to set.
877     */
878    public void setDefaultChart(Chart defaultChart) {
879        this.defaultChart = defaultChart;
880    }
881
882    /**
883     * Gets the defaultAccount attribute.
884     * 
885     * @return Returns the defaultAccount.
886     */
887    public Account getDefaultAccount() {
888        return defaultAccount;
889    }
890
891    /**
892     * Sets the defaultAccount attribute value.
893     * 
894     * @param defaultAccount The defaultAccount to set.
895     */
896    public void setDefaultAccount(Account defaultAccount) {
897        this.defaultAccount = defaultAccount;
898    }
899
900    /**
901     * Gets the defaultSubAccount attribute.
902     * 
903     * @return Returns the defaultSubAccount.
904     */
905    public SubAccount getDefaultSubAccount() {
906        return defaultSubAccount;
907    }
908
909    /**
910     * Sets the defaultSubAccount attribute value.
911     * 
912     * @param defaultSubAccount The defaultSubAccount to set.
913     */
914    public void setDefaultSubAccount(SubAccount defaultSubAccount) {
915        this.defaultSubAccount = defaultSubAccount;
916    }
917
918    /**
919     * Gets the defaultObject attribute.
920     * 
921     * @return Returns the defaultObject.
922     */
923    public ObjectCode getDefaultObject() {
924        return defaultObject;
925    }
926
927    /**
928     * Sets the defaultObject attribute value.
929     * 
930     * @param defaultObject The defaultObject to set.
931     */
932    public void setDefaultObject(ObjectCode defaultObject) {
933        this.defaultObject = defaultObject;
934    }
935
936    /**
937     * Gets the defaultSubObject attribute.
938     * 
939     * @return Returns the defaultSubObject.
940     */
941    public SubObjectCode getDefaultSubObject() {
942        return defaultSubObject;
943    }
944
945    /**
946     * Sets the defaultSubObject attribute value.
947     * 
948     * @param defaultSubObject The defaultSubObject to set.
949     */
950    public void setDefaultSubObject(SubObjectCode defaultSubObject) {
951        this.defaultSubObject = defaultSubObject;
952    }
953
954    /**
955     * Gets the state attribute.
956     * 
957     * @return Returns the state.
958     */
959    public StateEbo getState() {
960        if ( StringUtils.isBlank(stateCode) || StringUtils.isBlank(countryCode ) ) {
961            state = null;
962        } else {
963            if ( state == null || !StringUtils.equals( state.getCode(),stateCode) || !StringUtils.equals(state.getCountryCode(), countryCode ) ) {
964                ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(StateEbo.class);
965                if ( moduleService != null ) {
966                    Map<String,Object> keys = new HashMap<String, Object>(2);
967                    keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, countryCode);
968                    keys.put(LocationConstants.PrimaryKeyConstants.CODE, stateCode);
969                    state = moduleService.getExternalizableBusinessObject(StateEbo.class, keys);
970                } else {
971                    throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed." );
972                }
973            }
974        }
975        return state;
976    }
977
978    /**
979     * Sets the state attribute value.
980     * 
981     * @param state The state to set.
982     */
983    public void setState(StateEbo state) {
984        this.state = state;
985    }
986
987    /**
988     * Gets the postalCode attribute.
989     * 
990     * @return Returns the postalCode.
991     */
992    public PostalCodeEbo getPostalCode() {
993        if ( StringUtils.isBlank(zipCode) || StringUtils.isBlank(countryCode) ) {
994            postalCode = null;
995        } else {
996            if ( postalCode == null || !StringUtils.equals( postalCode.getCode(),zipCode) || !StringUtils.equals(postalCode.getCountryCode(), countryCode ) ) {
997                ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(PostalCodeEbo.class);
998                if ( moduleService != null ) {
999                    Map<String,Object> keys = new HashMap<String, Object>(2);
1000                    keys.put(LocationConstants.PrimaryKeyConstants.COUNTRY_CODE, countryCode);
1001                    keys.put(LocationConstants.PrimaryKeyConstants.CODE, zipCode);
1002                    postalCode = moduleService.getExternalizableBusinessObject(PostalCodeEbo.class, keys);
1003                } else {
1004                    throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed." );
1005                }
1006            }
1007        }
1008        return postalCode;
1009    }
1010
1011    /**
1012     * Sets the postalCode attribute value.
1013     * 
1014     * @param postalCode The postalCode to set.
1015     */
1016    public void setPostalCode(PostalCodeEbo postalCode) {
1017        this.postalCode = postalCode;
1018    }
1019
1020    /**
1021     * Gets the country attribute.
1022     * 
1023     * @return Returns the country.
1024     */
1025    public CountryEbo getCountry() {
1026        if ( StringUtils.isBlank(countryCode) ) {
1027            country = null;
1028        } else {
1029            if ( country == null || !StringUtils.equals( country.getCode(),countryCode) ) {
1030                ModuleService moduleService = SpringContext.getBean(KualiModuleService.class).getResponsibleModuleService(CountryEbo.class);
1031                if ( moduleService != null ) {
1032                    Map<String,Object> keys = new HashMap<String, Object>(1);
1033                    keys.put(LocationConstants.PrimaryKeyConstants.CODE, countryCode);
1034                    country = moduleService.getExternalizableBusinessObject(CountryEbo.class, keys);
1035                } else {
1036                    throw new RuntimeException( "CONFIGURATION ERROR: No responsible module found for EBO class.  Unable to proceed." );
1037                }
1038            }
1039        }
1040        return country;
1041    }
1042
1043    /**
1044     * Sets the country attribute value.
1045     * 
1046     * @param country The country to set.
1047     */
1048    public void setCountry(CountryEbo country) {
1049        this.country = country;
1050    }
1051
1052    /**
1053     * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable#isActive()
1054     */
1055    @Override
1056    public boolean isActive() {
1057        return active;
1058    }
1059
1060    /**
1061     * @see org.kuali.rice.core.api.mo.common.active.MutableInactivatable#setActive(boolean)
1062     */
1063    @Override
1064    public void setActive(boolean active) {
1065        this.active = active;
1066    }
1067
1068    /**
1069     * Gets the countryCode attribute. 
1070     * @return Returns the countryCode.
1071     */
1072    public String getCountryCode() {
1073        return countryCode;
1074    }
1075
1076    /**
1077     * Sets the countryCode attribute value.
1078     * @param countryCode The countryCode to set.
1079     */
1080    public void setCountryCode(String countryCode) {
1081        this.countryCode = countryCode;
1082    }
1083
1084    /**
1085     * Gets the achTransactionType attribute.
1086     * 
1087     * @return Returns the achTransactionType.
1088     */
1089    public String getAchTransactionType() {
1090        return achTransactionType;
1091    }
1092
1093    /**
1094     * Sets the achTransactionType attribute value.
1095     * 
1096     * @param achTransactionType The achTransactionType to set.
1097     */
1098    public void setAchTransactionType(String achTransactionType) {
1099        this.achTransactionType = achTransactionType;
1100    }
1101
1102    /**
1103     * Gets the transactionType attribute.
1104     * 
1105     * @return Returns the transactionType.
1106     */
1107    public ACHTransactionType getTransactionType() {
1108        return transactionType;
1109    }
1110
1111    /**
1112     * Sets the transactionType attribute value.
1113     * 
1114     * @param transactionType The transactionType to set.
1115     */
1116    public void setTransactionType(ACHTransactionType transactionType) {
1117        this.transactionType = transactionType;
1118    }
1119
1120    /**
1121     * This method gets the selected for format flag.
1122     * @return selectedForFormat
1123     */
1124    public boolean isSelectedForFormat() {
1125        return selectedForFormat;
1126}
1127    /**
1128     * This method sets the selectedForFormat value.
1129     * @param sameCampus
1130     */
1131    public void setSelectedForFormat(boolean sameCampus) {
1132        this.selectedForFormat = sameCampus;
1133    }
1134    
1135}