001    /*
002     * Copyright 2011 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    package org.kuali.kfs.coa.businessobject;
018    
019    import java.sql.Date;
020    import java.util.LinkedHashMap;
021    
022    import org.kuali.kfs.sys.context.SpringContext;
023    import org.kuali.rice.kew.doctype.bo.DocumentTypeEBO;
024    import org.kuali.rice.kew.service.impl.KEWModuleService;
025    import org.kuali.rice.kim.bo.Person;
026    import org.kuali.rice.kns.bo.Inactivateable;
027    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
028    import org.kuali.rice.kns.util.KualiDecimal;
029    
030    /**
031     * 
032     */
033    public class AccountDelegateModelDetail extends PersistableBusinessObjectBase implements Inactivateable {
034    
035        private String chartOfAccountsCode;
036        private String organizationCode;
037        private String accountDelegateModelName;
038        private String accountDelegateUniversalId;
039        private String financialDocumentTypeCode;
040        private KualiDecimal approvalFromThisAmount;
041        private KualiDecimal approvalToThisAmount;
042        private boolean accountDelegatePrimaryRoutingIndicator;
043        private Date accountDelegateStartDate;
044        private boolean active;
045    
046        private Chart chartOfAccounts;
047        private DocumentTypeEBO financialSystemDocumentTypeCode;
048        private Person accountDelegate;
049    
050        /**
051         * Default constructor.
052         */
053        public AccountDelegateModelDetail() {
054        }
055    
056        public AccountDelegateModelDetail(AccountDelegateGlobalDetail delegateGlobalDetail) {
057            accountDelegateUniversalId = delegateGlobalDetail.getAccountDelegateUniversalId();
058            accountDelegatePrimaryRoutingIndicator = delegateGlobalDetail.getAccountDelegatePrimaryRoutingIndicator();
059            approvalFromThisAmount = delegateGlobalDetail.getApprovalFromThisAmount();
060            approvalToThisAmount = delegateGlobalDetail.getApprovalToThisAmount();
061            accountDelegateStartDate = delegateGlobalDetail.getAccountDelegateStartDate();
062            financialDocumentTypeCode = delegateGlobalDetail.getFinancialDocumentTypeCode();
063        }
064    
065        /**
066         * Gets the chartOfAccountsCode attribute.
067         * 
068         * @return Returns the chartOfAccountsCode
069         */
070        public String getChartOfAccountsCode() {
071            return chartOfAccountsCode;
072        }
073    
074        /**
075         * Sets the chartOfAccountsCode attribute.
076         * 
077         * @param chartOfAccountsCode The chartOfAccountsCode to set.
078         */
079        public void setChartOfAccountsCode(String chartOfAccountsCode) {
080            this.chartOfAccountsCode = chartOfAccountsCode;
081        }
082    
083    
084        /**
085         * Gets the organizationCode attribute.
086         * 
087         * @return Returns the organizationCode
088         */
089        public String getOrganizationCode() {
090            return organizationCode;
091        }
092    
093        /**
094         * Sets the organizationCode attribute.
095         * 
096         * @param organizationCode The organizationCode to set.
097         */
098        public void setOrganizationCode(String organizationCode) {
099            this.organizationCode = organizationCode;
100        }
101    
102    
103        /**
104         * Gets the accountDelegateModelName attribute.
105         * 
106         * @return Returns the accountDelegateModelName
107         */
108        public String getAccountDelegateModelName() {
109            return accountDelegateModelName;
110        }
111    
112        /**
113         * Sets the accountDelegateModelName attribute.
114         * 
115         * @param accountDelegateModelName The accountDelegateModelName to set.
116         */
117        public void setAccountDelegateModelName(String organizationRoutingModelName) {
118            this.accountDelegateModelName = organizationRoutingModelName;
119        }
120    
121    
122        /**
123         * Gets the accountDelegateUniversalId attribute.
124         * 
125         * @return Returns the accountDelegateUniversalId
126         */
127        public String getAccountDelegateUniversalId() {
128            return accountDelegateUniversalId;
129        }
130    
131        /**
132         * Sets the accountDelegateUniversalId attribute.
133         * 
134         * @param accountDelegateUniversalId The accountDelegateUniversalId to set.
135         */
136        public void setAccountDelegateUniversalId(String accountDelegateUniversalId) {
137            this.accountDelegateUniversalId = accountDelegateUniversalId;
138        }
139    
140    
141        /**
142         * Gets the accountDelegate attribute.
143         * 
144         * @return Returns the accountDelegate.
145         */
146        public Person getAccountDelegate() {
147            accountDelegate = SpringContext.getBean(org.kuali.rice.kim.service.PersonService.class).updatePersonIfNecessary(accountDelegateUniversalId, accountDelegate);
148            return accountDelegate;
149        }
150    
151        /**
152         * Sets the accountDelegate attribute value.
153         * 
154         * @param accountDelegate The accountDelegate to set.
155         */
156        public void setAccountDelegate(Person accountDelegate) {
157            this.accountDelegate = accountDelegate;
158        }
159    
160        /**
161         * Gets the financialDocumentTypeCode attribute.
162         * 
163         * @return Returns the financialDocumentTypeCode
164         */
165        public String getFinancialDocumentTypeCode() {
166            return financialDocumentTypeCode;
167        }
168    
169        /**
170         * Sets the financialDocumentTypeCode attribute.
171         * 
172         * @param financialDocumentTypeCode The financialDocumentTypeCode to set.
173         */
174        public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
175            this.financialDocumentTypeCode = financialDocumentTypeCode;
176        }
177    
178        /**
179         * Gets the financialSystemDocumentTypeCode attribute. 
180         * @return Returns the financialSystemDocumentTypeCode.
181         */
182        public DocumentTypeEBO getFinancialSystemDocumentTypeCode() {
183            return financialSystemDocumentTypeCode = SpringContext.getBean(KEWModuleService.class).retrieveExternalizableBusinessObjectIfNecessary(this, financialSystemDocumentTypeCode, "financialSystemDocumentTypeCode");
184        }
185    
186        /**
187         * Gets the approvalFromThisAmount attribute.
188         * 
189         * @return Returns the approvalFromThisAmount
190         */
191        public KualiDecimal getApprovalFromThisAmount() {
192            return approvalFromThisAmount;
193        }
194    
195        /**
196         * Sets the approvalFromThisAmount attribute.
197         * 
198         * @param approvalFromThisAmount The approvalFromThisAmount to set.
199         */
200        public void setApprovalFromThisAmount(KualiDecimal approvalFromThisAmount) {
201            this.approvalFromThisAmount = approvalFromThisAmount;
202        }
203    
204    
205        /**
206         * Gets the approvalToThisAmount attribute.
207         * 
208         * @return Returns the approvalToThisAmount
209         */
210        public KualiDecimal getApprovalToThisAmount() {
211            return approvalToThisAmount;
212        }
213    
214        /**
215         * Sets the approvalToThisAmount attribute.
216         * 
217         * @param approvalToThisAmount The approvalToThisAmount to set.
218         */
219        public void setApprovalToThisAmount(KualiDecimal approvalToThisAmount) {
220            this.approvalToThisAmount = approvalToThisAmount;
221        }
222    
223    
224        /**
225         * Gets the accountDelegatePrimaryRoutingIndicator attribute.
226         * 
227         * @return Returns the accountDelegatePrimaryRoutingIndicator
228         */
229        public boolean getAccountDelegatePrimaryRoutingIndicator() {
230            return accountDelegatePrimaryRoutingIndicator;
231        }
232    
233        /**
234         * Sets the accountDelegatePrimaryRoutingIndicator attribute.
235         * 
236         * @param accountDelegatePrimaryRoutingCode The accountDelegatePrimaryRoutingIndicator to set.
237         */
238        public void setAccountDelegatePrimaryRoutingIndicator(boolean accountDelegatePrimaryRoutingCode) {
239            this.accountDelegatePrimaryRoutingIndicator = accountDelegatePrimaryRoutingCode;
240        }
241    
242    
243        /**
244         * Gets the accountDelegateStartDate attribute.
245         * 
246         * @return Returns the accountDelegateStartDate
247         */
248        public Date getAccountDelegateStartDate() {
249            return accountDelegateStartDate;
250        }
251    
252        /**
253         * Sets the accountDelegateStartDate attribute.
254         * 
255         * @param accountDelegateStartDate The accountDelegateStartDate to set.
256         */
257        public void setAccountDelegateStartDate(Date accountDelegateStartDate) {
258            this.accountDelegateStartDate = accountDelegateStartDate;
259        }
260    
261        /**
262         * Gets the active attribute.
263         * 
264         * @return Returns the active.
265         */
266        public boolean isActive() {
267            return active;
268        }
269    
270        /**
271         * Sets the active attribute value.
272         * 
273         * @param active The active to set.
274         */
275        public void setActive(boolean active) {
276            this.active = active;
277        }
278    
279        /**
280         * Gets the chartOfAccounts attribute.
281         * 
282         * @return Returns the chartOfAccounts
283         */
284        public Chart getChartOfAccounts() {
285            return chartOfAccounts;
286        }
287    
288        /**
289         * Sets the chartOfAccounts attribute.
290         * 
291         * @param chartOfAccounts The chartOfAccounts to set.
292         * @deprecated
293         */
294        public void setChartOfAccounts(Chart chartOfAccounts) {
295            this.chartOfAccounts = chartOfAccounts;
296        }
297    
298        /**
299         * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper()
300         */
301        protected LinkedHashMap toStringMapper() {
302            LinkedHashMap m = new LinkedHashMap();
303            m.put("chartOfAccountsCode", this.chartOfAccountsCode);
304            m.put("organizationCode", this.organizationCode);
305            m.put("accountDelegateModelName", this.accountDelegateModelName);
306            m.put("accountDelegateUniversalId", this.accountDelegateUniversalId);
307            m.put("financialDocumentTypeCode", this.financialDocumentTypeCode);
308            return m;
309        }
310    }
311