001: /*
002: * Copyright 2007 The Kuali Foundation.
003: *
004: * Licensed under the Educational Community License, Version 1.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/ecl1.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.module.labor.bo;
018:
019: import org.kuali.core.util.KualiDecimal;
020:
021: /**
022: * Labor business object for Account Status (Base Funds).
023: */
024: public class AccountStatusBaseFunds extends LedgerBalance {
025: private KualiDecimal csfAmount;
026: private KualiDecimal baseBudgetAmount;
027: private KualiDecimal baseCSFVarianceAmount;
028:
029: /**
030: * Default constructor.
031: */
032: public AccountStatusBaseFunds() {
033: super ();
034: this .setBaseCSFVarianceAmount(KualiDecimal.ZERO);
035: this .setCsfAmount(KualiDecimal.ZERO);
036: this .setBaseBudgetAmount(KualiDecimal.ZERO);
037: }
038:
039: /**
040: * Gets the baseBudgetAmount attribute.
041: *
042: * @return Returns the baseBudgetAmount.
043: */
044: public KualiDecimal getBaseBudgetAmount() {
045: return this .getAccountLineAnnualBalanceAmount().add(
046: this .getFinancialBeginningBalanceLineAmount()).add(
047: this .getContractsGrantsBeginningBalanceAmount());
048: }
049:
050: /**
051: * Sets the baseBudgetAmount attribute value.
052: *
053: * @param baseBudgetAmount The baseBudgetAmount to set.
054: */
055: public void setBaseBudgetAmount(KualiDecimal baseBudgetAmount) {
056: this .baseBudgetAmount = baseBudgetAmount;
057: }
058:
059: /**
060: * Gets the baseCSFVarianceAmount attribute.
061: *
062: * @return Returns the baseCSFVarianceAmount.
063: */
064: public KualiDecimal getBaseCSFVarianceAmount() {
065: return this .getBaseBudgetAmount().subtract(this .getCsfAmount());
066: }
067:
068: /**
069: * Sets the baseCSFVarianceAmount attribute value.
070: *
071: * @param baseCSFVarianceAmount The baseCSFVarianceAmount to set.
072: */
073: public void setBaseCSFVarianceAmount(
074: KualiDecimal baseCSFVarianceAmount) {
075: this .baseCSFVarianceAmount = baseCSFVarianceAmount;
076: }
077:
078: /**
079: * Gets the csfAmount attribute.
080: *
081: * @return Returns the csfAmount.
082: */
083: public KualiDecimal getCsfAmount() {
084: return csfAmount;
085: }
086:
087: /**
088: * Sets the csfAmount attribute value.
089: *
090: * @param csfAmount The csfAmount to set.
091: */
092: public void setCsfAmount(KualiDecimal csfAmount) {
093: this .csfAmount = csfAmount;
094: }
095:
096: /**
097: * @see java.lang.Object#hashCode()
098: */
099: @Override
100: public int hashCode() {
101: final int PRIME = 31;
102: int result = 1;
103: result = PRIME
104: * result
105: + ((getAccountNumber() == null) ? 0
106: : getAccountNumber().hashCode());
107: result = PRIME
108: * result
109: + ((getChartOfAccountsCode() == null) ? 0
110: : getChartOfAccountsCode().hashCode());
111: result = PRIME
112: * result
113: + ((getFinancialObjectCode() == null) ? 0
114: : getFinancialObjectCode().hashCode());
115: result = PRIME
116: * result
117: + ((getFinancialSubObjectCode() == null) ? 0
118: : getFinancialSubObjectCode().hashCode());
119: result = PRIME
120: * result
121: + ((getSubAccountNumber() == null) ? 0
122: : getSubAccountNumber().hashCode());
123: result = PRIME
124: * result
125: + ((getUniversityFiscalYear() == null) ? 0
126: : getUniversityFiscalYear().hashCode());
127:
128: return result;
129: }
130:
131: /**
132: * @see java.lang.Object#equals(java.lang.Object)
133: */
134: @Override
135: public boolean equals(Object obj) {
136: if (this == obj)
137: return true;
138: if (obj == null)
139: return false;
140: if (getClass() != obj.getClass())
141: return false;
142:
143: final AccountStatusBaseFunds other = (AccountStatusBaseFunds) obj;
144: if (getAccountNumber() == null) {
145: if (other.getAccountNumber() != null)
146: return false;
147: } else if (!getAccountNumber().equals(other.getAccountNumber())) {
148: return false;
149: }
150:
151: if (getChartOfAccountsCode() == null) {
152: if (other.getChartOfAccountsCode() != null)
153: return false;
154: } else if (!getChartOfAccountsCode().equals(
155: other.getChartOfAccountsCode())) {
156: return false;
157: }
158:
159: if (getFinancialObjectCode() == null) {
160: if (other.getFinancialObjectCode() != null)
161: return false;
162: } else if (!getFinancialObjectCode().equals(
163: other.getFinancialObjectCode())) {
164: return false;
165: }
166:
167: if (getFinancialSubObjectCode() == null) {
168: if (other.getFinancialSubObjectCode() != null)
169: return false;
170: } else if (!getFinancialSubObjectCode().equals(
171: other.getFinancialSubObjectCode())) {
172: return false;
173: }
174:
175: if (getSubAccountNumber() == null) {
176: if (other.getSubAccountNumber() != null)
177: return false;
178: } else if (!getSubAccountNumber().equals(
179: other.getSubAccountNumber())) {
180: return false;
181: }
182:
183: if (getUniversityFiscalYear() == null) {
184: if (other.getUniversityFiscalYear() != null)
185: return false;
186: } else if (!getUniversityFiscalYear().equals(
187: other.getUniversityFiscalYear())) {
188: return false;
189: }
190:
191: return true;
192: }
193: }
|