View Javadoc
1   /*
2    * Copyright 2005-2006 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    * http://www.opensource.org/licenses/ecl2.php
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.ole.coa.businessobject;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.kuali.ole.sys.businessobject.FiscalYearBasedBusinessObject;
20  import org.kuali.ole.sys.businessobject.SystemOptions;
21  import org.kuali.ole.sys.context.SpringContext;
22  import org.kuali.rice.kew.api.doctype.DocumentTypeService;
23  import org.kuali.rice.kew.doctype.bo.DocumentType;
24  import org.kuali.rice.kew.doctype.bo.DocumentTypeEBO;
25  import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
26  
27  /**
28   * 
29   */
30  public class OffsetDefinition extends PersistableBusinessObjectBase implements FiscalYearBasedBusinessObject {
31  
32      private static final long serialVersionUID = -6150010338773403021L;
33  
34      private Integer universityFiscalYear;
35      private String financialDocumentTypeCode;
36      private String financialBalanceTypeCode;
37      private String chartOfAccountsCode;
38      private String financialObjectCode;
39  
40      private SystemOptions universityFiscal;
41      private ObjectCode financialObject;
42      private Chart chartOfAccounts;
43      private BalanceType financialBalanceType;
44      private DocumentTypeEBO financialSystemDocumentTypeCode;
45  
46      /**
47       * Default no-arg constructor.
48       */
49      public OffsetDefinition() {
50  
51      }
52  
53      /**
54       * Gets the universityFiscalYear attribute.
55       * 
56       * @return Returns the universityFiscalYear
57       */
58      @Override
59      public Integer getUniversityFiscalYear() {
60          return universityFiscalYear;
61      }
62  
63      /**
64       * Sets the universityFiscalYear attribute.
65       * 
66       * @param universityFiscalYear The universityFiscalYear to set.
67       */
68      @Override
69      public void setUniversityFiscalYear(Integer universityFiscalYear) {
70          this.universityFiscalYear = universityFiscalYear;
71      }
72  
73      /**
74       * Gets the universityFiscal attribute.
75       * 
76       * @return Returns the universityFiscal
77       */
78      public SystemOptions getUniversityFiscal() {
79          return universityFiscal;
80      }
81  
82      /**
83       * Sets the universityFiscal attribute.
84       * 
85       * @param universityFiscal The universityFiscal to set.
86       * @deprecated
87       */
88      public void setUniversityFiscal(SystemOptions universityFiscal) {
89          this.universityFiscal = universityFiscal;
90      }
91  
92      /**
93       * Gets the financialDocumentTypeCode attribute.
94       * 
95       * @return Returns the financialDocumentTypeCode
96       */
97  
98      public String getFinancialDocumentTypeCode() {
99          return financialDocumentTypeCode;
100     }
101 
102     /**
103      * Sets the financialDocumentTypeCode attribute.
104      * 
105      * @param financialDocumentTypeCode The financialDocumentTypeCode to set.
106      */
107     public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) {
108         this.financialDocumentTypeCode = financialDocumentTypeCode;
109     }
110 
111     /**
112      * Gets the financialBalanceTypeCode attribute.
113      * 
114      * @return Returns the financialBalanceTypeCode
115      */
116     public String getFinancialBalanceTypeCode() {
117         return financialBalanceTypeCode;
118     }
119 
120     /**
121      * Sets the financialBalanceTypeCode attribute.
122      * 
123      * @param financialBalanceTypeCode The financialBalanceTypeCode to set.
124      */
125     public void setFinancialBalanceTypeCode(String financialBalanceTypeCode) {
126         this.financialBalanceTypeCode = financialBalanceTypeCode;
127     }
128 
129     /**
130      * Returns the BalanceType object associated with this OffsetDefinition
131      * 
132      * @return the balanceType
133      */
134     public BalanceType getFinancialBalanceType() {
135         return financialBalanceType;
136     }
137 
138     /**
139      * Sets the balanceType from the balanceTypeCode
140      * 
141      * @param financialBalanceType
142      * @deprecated
143      */
144     public void setFinancialBalanceType(BalanceType financialBalanceType) {
145         this.financialBalanceType = financialBalanceType;
146     }
147 
148     /**
149      * Gets the financialObjectCode attribute.
150      * 
151      * @return Returns the financialObjectCode
152      */
153 
154     public String getFinancialObjectCode() {
155         return financialObjectCode;
156     }
157 
158     /**
159      * Sets the financialObjectCode attribute.
160      * 
161      * @param financialObjectCode The financialObjectCode to set.
162      */
163     public void setFinancialObjectCode(String financialObjectCode) {
164         this.financialObjectCode = financialObjectCode;
165     }
166 
167     /**
168      * Gets the financialObject attribute.
169      * 
170      * @return Returns the financialObject
171      */
172 
173     public ObjectCode getFinancialObject() {
174         return financialObject;
175     }
176 
177     /**
178      * Sets the financialObject attribute.
179      * 
180      * @param financialObject The financialObject to set.
181      * @deprecated
182      */
183     public void setFinancialObject(ObjectCode financialObject) {
184         this.financialObject = financialObject;
185     }
186 
187     /**
188      * Gets the chartOfAccounts attribute.
189      * 
190      * @return Returns the chartOfAccounts
191      */
192 
193     public String getChartOfAccountsCode() {
194         return chartOfAccountsCode;
195     }
196 
197     /**
198      * Sets the chartOfAccountsCode attribute.
199      * 
200      * @param chartOfAccountsCode The chartOfAccountsCode to set.
201      */
202     public void setChartOfAccountsCode(String chartOfAccountsCode) {
203         this.chartOfAccountsCode = chartOfAccountsCode;
204     }
205 
206     /**
207      * Gets the chartOfAccounts object
208      * 
209      * @return a Chart object
210      */
211     public Chart getChartOfAccounts() {
212         return chartOfAccounts;
213     }
214 
215     /**
216      * Sets the chartOfAccountsCode attribute.
217      * 
218      * @param chartOfAccountsCode The chartOfAccounts to set.
219      * @deprecated
220      */
221     public void setChartOfAccounts(Chart chartOfAccounts) {
222         this.chartOfAccounts = chartOfAccounts;
223     }
224 
225     /**
226      * Gets the financialSystemDocumentTypeCode attribute.
227      * 
228      * @return Returns the financialSystemDocumentTypeCode.
229      */
230     public DocumentTypeEBO getFinancialSystemDocumentTypeCode() {
231         if ( StringUtils.isBlank( financialDocumentTypeCode ) ) {
232             financialSystemDocumentTypeCode = null;
233         } else {
234             if ( financialSystemDocumentTypeCode == null || !StringUtils.equals(financialDocumentTypeCode, financialSystemDocumentTypeCode.getName() ) ) {
235                 org.kuali.rice.kew.api.doctype.DocumentType temp = SpringContext.getBean(DocumentTypeService.class).getDocumentTypeByName(financialDocumentTypeCode);
236                 if ( temp != null ) {
237                     financialSystemDocumentTypeCode = DocumentType.from( temp );
238                 } else {
239                     financialSystemDocumentTypeCode = null;
240                 }
241             }
242         }
243         return financialSystemDocumentTypeCode;
244     }
245 
246     /**
247      * This method (a hack by any other name...) returns a string so that an offset Definition can have a link to view its own
248      * inquiry page after a look up
249      * 
250      * @return the String "View Offset Definition"
251      */
252     public String getOffsetDefinitionViewer() {
253         return "View Offset Definition";
254     }
255 
256 
257 }