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 package org.kuali.kfs.coa.businessobject; 017 018 import java.util.LinkedHashMap; 019 020 import org.kuali.kfs.sys.businessobject.SystemOptions; 021 import org.kuali.kfs.sys.context.SpringContext; 022 import org.kuali.rice.kew.doctype.bo.DocumentTypeEBO; 023 import org.kuali.rice.kew.service.impl.KEWModuleService; 024 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase; 025 026 /** 027 * 028 */ 029 public class OffsetDefinition extends PersistableBusinessObjectBase { 030 031 private static final long serialVersionUID = -6150010338773403021L; 032 033 private Integer universityFiscalYear; 034 private String financialDocumentTypeCode; 035 private String financialBalanceTypeCode; 036 private String chartOfAccountsCode; 037 private String financialObjectCode; 038 039 private SystemOptions universityFiscal; 040 private ObjectCode financialObject; 041 private Chart chartOfAccounts; 042 private BalanceType financialBalanceType; 043 private DocumentTypeEBO financialSystemDocumentTypeCode; 044 045 /** 046 * Default no-arg constructor. 047 */ 048 public OffsetDefinition() { 049 050 } 051 052 /** 053 * Gets the universityFiscalYear attribute. 054 * 055 * @return Returns the universityFiscalYear 056 */ 057 public Integer getUniversityFiscalYear() { 058 return universityFiscalYear; 059 } 060 061 /** 062 * Sets the universityFiscalYear attribute. 063 * 064 * @param universityFiscalYear The universityFiscalYear to set. 065 */ 066 public void setUniversityFiscalYear(Integer universityFiscalYear) { 067 this.universityFiscalYear = universityFiscalYear; 068 } 069 070 /** 071 * Gets the universityFiscal attribute. 072 * 073 * @return Returns the universityFiscal 074 */ 075 public SystemOptions getUniversityFiscal() { 076 return universityFiscal; 077 } 078 079 /** 080 * Sets the universityFiscal attribute. 081 * 082 * @param universityFiscal The universityFiscal to set. 083 * @deprecated 084 */ 085 public void setUniversityFiscal(SystemOptions universityFiscal) { 086 this.universityFiscal = universityFiscal; 087 } 088 089 /** 090 * Gets the financialDocumentTypeCode attribute. 091 * 092 * @return Returns the financialDocumentTypeCode 093 */ 094 095 public String getFinancialDocumentTypeCode() { 096 return financialDocumentTypeCode; 097 } 098 099 /** 100 * Sets the financialDocumentTypeCode attribute. 101 * 102 * @param financialDocumentTypeCode The financialDocumentTypeCode to set. 103 */ 104 public void setFinancialDocumentTypeCode(String financialDocumentTypeCode) { 105 this.financialDocumentTypeCode = financialDocumentTypeCode; 106 } 107 108 /** 109 * Gets the financialBalanceTypeCode attribute. 110 * 111 * @return Returns the financialBalanceTypeCode 112 */ 113 public String getFinancialBalanceTypeCode() { 114 return financialBalanceTypeCode; 115 } 116 117 /** 118 * Sets the financialBalanceTypeCode attribute. 119 * 120 * @param financialBalanceTypeCode The financialBalanceTypeCode to set. 121 */ 122 public void setFinancialBalanceTypeCode(String financialBalanceTypeCode) { 123 this.financialBalanceTypeCode = financialBalanceTypeCode; 124 } 125 126 /** 127 * Returns the BalanceType object associated with this OffsetDefinition 128 * 129 * @return the balanceType 130 */ 131 public BalanceType getFinancialBalanceType() { 132 return financialBalanceType; 133 } 134 135 /** 136 * Sets the balanceType from the balanceTypeCode 137 * 138 * @param financialBalanceType 139 * @deprecated 140 */ 141 public void setFinancialBalanceType(BalanceType financialBalanceType) { 142 this.financialBalanceType = financialBalanceType; 143 } 144 145 /** 146 * Gets the financialObjectCode attribute. 147 * 148 * @return Returns the financialObjectCode 149 */ 150 151 public String getFinancialObjectCode() { 152 return financialObjectCode; 153 } 154 155 /** 156 * Sets the financialObjectCode attribute. 157 * 158 * @param financialObjectCode The financialObjectCode to set. 159 */ 160 public void setFinancialObjectCode(String financialObjectCode) { 161 this.financialObjectCode = financialObjectCode; 162 } 163 164 /** 165 * Gets the financialObject attribute. 166 * 167 * @return Returns the financialObject 168 */ 169 170 public ObjectCode getFinancialObject() { 171 return financialObject; 172 } 173 174 /** 175 * Sets the financialObject attribute. 176 * 177 * @param financialObject The financialObject to set. 178 * @deprecated 179 */ 180 public void setFinancialObject(ObjectCode financialObject) { 181 this.financialObject = financialObject; 182 } 183 184 /** 185 * Gets the chartOfAccounts attribute. 186 * 187 * @return Returns the chartOfAccounts 188 */ 189 190 public String getChartOfAccountsCode() { 191 return chartOfAccountsCode; 192 } 193 194 /** 195 * Sets the chartOfAccountsCode attribute. 196 * 197 * @param chartOfAccountsCode The chartOfAccountsCode to set. 198 */ 199 public void setChartOfAccountsCode(String chartOfAccountsCode) { 200 this.chartOfAccountsCode = chartOfAccountsCode; 201 } 202 203 /** 204 * Gets the chartOfAccounts object 205 * 206 * @return a Chart object 207 */ 208 public Chart getChartOfAccounts() { 209 return chartOfAccounts; 210 } 211 212 /** 213 * Sets the chartOfAccountsCode attribute. 214 * 215 * @param chartOfAccountsCode The chartOfAccounts to set. 216 * @deprecated 217 */ 218 public void setChartOfAccounts(Chart chartOfAccounts) { 219 this.chartOfAccounts = chartOfAccounts; 220 } 221 222 /** 223 * Gets the financialSystemDocumentTypeCode attribute. 224 * 225 * @return Returns the financialSystemDocumentTypeCode. 226 */ 227 public DocumentTypeEBO getFinancialSystemDocumentTypeCode() { 228 return financialSystemDocumentTypeCode = SpringContext.getBean(KEWModuleService.class).retrieveExternalizableBusinessObjectIfNecessary(this, financialSystemDocumentTypeCode, "financialSystemDocumentTypeCode"); 229 } 230 231 /** 232 * This method (a hack by any other name...) returns a string so that an offset Definition can have a link to view its own 233 * inquiry page after a look up 234 * 235 * @return the String "View Offset Definition" 236 */ 237 public String getOffsetDefinitionViewer() { 238 return "View Offset Definition"; 239 } 240 241 /** 242 * @see org.kuali.rice.kns.bo.BusinessObjectBase#toStringMapper() 243 */ 244 protected LinkedHashMap toStringMapper() { 245 LinkedHashMap m = new LinkedHashMap(); 246 m.put("universityFiscalYear", this.universityFiscalYear); 247 m.put("chartOfAccountsCode", this.chartOfAccountsCode); 248 m.put("documentTypeCode", this.financialDocumentTypeCode); 249 m.put("balanceTypeCode", this.financialBalanceTypeCode); 250 return m; 251 } 252 253 254 }