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.gl.businessobject; 017 018 import java.util.LinkedHashMap; 019 020 import org.kuali.kfs.coa.businessobject.Account; 021 import org.kuali.kfs.sys.businessobject.SystemOptions; 022 import org.kuali.rice.kns.bo.PersistableBusinessObjectBase; 023 import org.kuali.rice.kns.util.KualiDecimal; 024 025 /** 026 * Represents a expenditure transaction for a specific fiscal year, COA code, account number, 027 * sub account number, object code, sub-object code, balance type code, object type code, 028 * fiscal accounting period, project code, organization reference ID 029 */ 030 public class ExpenditureTransaction extends PersistableBusinessObjectBase { 031 static final long serialVersionUID = 5296540728313789670L; 032 033 private final static String UNIVERISITY_FISCAL_YEAR = "universityFiscalYear"; 034 private final static String CHART_OF_ACCOUNTS_CODE = "chartOfAccountsCode"; 035 private final static String ACCOUNT_NUMBER = "accountNumber"; 036 private final static String SUB_ACCOUNT_NUMBER = "subAccountNumber"; 037 private final static String OBJECT_CODE = "objectCode"; 038 private final static String BALANCE_TYPE_CODE = "balanceTypeCode"; 039 private final static String OBJECT_TYPE_CODE = "objectTypeCode"; 040 private final static String UNIVERSITY_FISCAL_ACCOUNTING_PERIOD = "universityFiscalAccountingPeriod"; 041 private final static String SUB_OBJECT_CODE = "subObjectCode"; 042 private final static String PROJECT_CODE = "projectCode"; 043 private final static String ORGANIZATION_REFERENCE_ID = "organizationReferenceId"; 044 045 private Integer universityFiscalYear; 046 private String chartOfAccountsCode; 047 private String accountNumber; 048 private String subAccountNumber; 049 private String objectCode; 050 private String subObjectCode; 051 private String balanceTypeCode; 052 private String objectTypeCode; 053 private String universityFiscalAccountingPeriod; 054 private String projectCode; 055 private String organizationReferenceId; 056 private KualiDecimal accountObjectDirectCostAmount; 057 058 private Account account; 059 private SystemOptions option; 060 061 /** 062 * 063 */ 064 public ExpenditureTransaction() { 065 super(); 066 } 067 068 public ExpenditureTransaction(Transaction t) { 069 universityFiscalYear = t.getUniversityFiscalYear(); 070 chartOfAccountsCode = t.getChartOfAccountsCode(); 071 accountNumber = t.getAccountNumber(); 072 subAccountNumber = t.getSubAccountNumber(); 073 objectCode = t.getFinancialObjectCode(); 074 subObjectCode = t.getFinancialSubObjectCode(); 075 balanceTypeCode = t.getFinancialBalanceTypeCode(); 076 objectTypeCode = t.getFinancialObjectTypeCode(); 077 universityFiscalAccountingPeriod = t.getUniversityFiscalPeriodCode(); 078 projectCode = t.getProjectCode(); 079 organizationReferenceId = t.getOrganizationReferenceId(); 080 accountObjectDirectCostAmount = new KualiDecimal(KualiDecimal.ZERO.toString()); 081 } 082 083 protected LinkedHashMap toStringMapper() { 084 LinkedHashMap map = new LinkedHashMap(); 085 map.put(UNIVERISITY_FISCAL_YEAR, getUniversityFiscalYear()); 086 map.put(CHART_OF_ACCOUNTS_CODE, getChartOfAccountsCode()); 087 map.put(ACCOUNT_NUMBER, getAccountNumber()); 088 map.put(SUB_ACCOUNT_NUMBER, getSubAccountNumber()); 089 map.put(OBJECT_CODE, getObjectCode()); 090 map.put(SUB_OBJECT_CODE, getSubObjectCode()); 091 map.put(BALANCE_TYPE_CODE, getBalanceTypeCode()); 092 map.put(OBJECT_TYPE_CODE, getObjectTypeCode()); 093 map.put(UNIVERSITY_FISCAL_ACCOUNTING_PERIOD, getUniversityFiscalAccountingPeriod()); 094 map.put(PROJECT_CODE, getProjectCode()); 095 map.put(ORGANIZATION_REFERENCE_ID, getOrganizationReferenceId()); 096 return map; 097 } 098 099 public SystemOptions getOption() { 100 return option; 101 } 102 103 public void setOption(SystemOptions option) { 104 this.option = option; 105 } 106 107 public Account getAccount() { 108 return account; 109 } 110 111 public void setAccount(Account a) { 112 account = a; 113 } 114 115 public String getAccountNumber() { 116 return accountNumber; 117 } 118 119 public void setAccountNumber(String accountNumber) { 120 this.accountNumber = accountNumber; 121 } 122 123 public KualiDecimal getAccountObjectDirectCostAmount() { 124 return accountObjectDirectCostAmount; 125 } 126 127 public void setAccountObjectDirectCostAmount(KualiDecimal accountObjectDirectCostAmount) { 128 this.accountObjectDirectCostAmount = accountObjectDirectCostAmount; 129 } 130 131 public String getBalanceTypeCode() { 132 return balanceTypeCode; 133 } 134 135 public void setBalanceTypeCode(String balanceTypeCode) { 136 this.balanceTypeCode = balanceTypeCode; 137 } 138 139 public String getChartOfAccountsCode() { 140 return chartOfAccountsCode; 141 } 142 143 public void setChartOfAccountsCode(String chartOfAccountsCode) { 144 this.chartOfAccountsCode = chartOfAccountsCode; 145 } 146 147 public String getObjectCode() { 148 return objectCode; 149 } 150 151 public void setObjectCode(String objectCode) { 152 this.objectCode = objectCode; 153 } 154 155 public String getObjectTypeCode() { 156 return objectTypeCode; 157 } 158 159 public void setObjectTypeCode(String objectTypeCode) { 160 this.objectTypeCode = objectTypeCode; 161 } 162 163 public String getOrganizationReferenceId() { 164 return organizationReferenceId; 165 } 166 167 public void setOrganizationReferenceId(String organizationReferenceId) { 168 this.organizationReferenceId = organizationReferenceId; 169 } 170 171 public String getProjectCode() { 172 return projectCode; 173 } 174 175 public void setProjectCode(String projectCode) { 176 this.projectCode = projectCode; 177 } 178 179 public String getSubAccountNumber() { 180 return subAccountNumber; 181 } 182 183 public void setSubAccountNumber(String subAccountNumber) { 184 this.subAccountNumber = subAccountNumber; 185 } 186 187 public String getSubObjectCode() { 188 return subObjectCode; 189 } 190 191 public void setSubObjectCode(String subObjectCode) { 192 this.subObjectCode = subObjectCode; 193 } 194 195 public String getUniversityFiscalAccountingPeriod() { 196 return universityFiscalAccountingPeriod; 197 } 198 199 public void setUniversityFiscalAccountingPeriod(String universityFiscalAccountingPeriod) { 200 this.universityFiscalAccountingPeriod = universityFiscalAccountingPeriod; 201 } 202 203 public Integer getUniversityFiscalYear() { 204 return universityFiscalYear; 205 } 206 207 public void setUniversityFiscalYear(Integer universityFiscalYear) { 208 this.universityFiscalYear = universityFiscalYear; 209 } 210 }