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.module.purap.businessobject;
017    
018    
019    import java.util.LinkedHashMap;
020    
021    import org.apache.commons.lang.builder.EqualsBuilder;
022    import org.apache.commons.lang.builder.HashCodeBuilder;
023    import org.kuali.kfs.sys.businessobject.AccountingLine;
024    import org.kuali.rice.kns.bo.PersistableBusinessObjectBase;
025    import org.kuali.rice.kns.util.KualiDecimal;
026    
027    public abstract class PurApItemUseTaxBase extends PersistableBusinessObjectBase implements PurApItemUseTax {
028    
029        private Integer useTaxId;
030        private Integer itemIdentifier;
031        private String rateCode;
032        private KualiDecimal taxAmount;
033        private String chartOfAccountsCode;
034        private String accountNumber;
035        private String financialObjectCode;
036    
037        public PurApItemUseTaxBase() {
038            super();
039        }
040    
041        public PurApItemUseTaxBase(PurApItemUseTax itemUseTax) {
042            super();
043            setAccountNumber(itemUseTax.getAccountNumber());
044            setChartOfAccountsCode(itemUseTax.getChartOfAccountsCode());
045            setFinancialObjectCode(itemUseTax.getFinancialObjectCode());
046            setRateCode(itemUseTax.getRateCode());
047            setTaxAmount(itemUseTax.getTaxAmount());
048        }
049    
050        public String getAccountNumber() {
051            return accountNumber;
052        }
053    
054        public void setAccountNumber(String accountNumber) {
055            this.accountNumber = accountNumber;
056        }
057    
058        public String getChartOfAccountsCode() {
059            return chartOfAccountsCode;
060        }
061    
062        public void setChartOfAccountsCode(String chartOfAccountsCode) {
063            this.chartOfAccountsCode = chartOfAccountsCode;
064        }
065    
066        public String getFinancialObjectCode() {
067            return financialObjectCode;
068        }
069    
070        public void setFinancialObjectCode(String financialObjectCode) {
071            this.financialObjectCode = financialObjectCode;
072        }
073    
074        public Integer getItemIdentifier() {
075            return itemIdentifier;
076        }
077    
078        public void setItemIdentifier(Integer itemIdentifier) {
079            this.itemIdentifier = itemIdentifier;
080        }
081    
082        public Integer getUseTaxId() {
083            return useTaxId;
084        }
085    
086        public void setUseTaxId(Integer useTaxId) {
087            this.useTaxId = useTaxId;
088        }
089    
090        public String getRateCode() {
091            return rateCode;
092        }
093    
094        public void setRateCode(String rateCode) {
095            this.rateCode = rateCode;
096        }
097    
098        public KualiDecimal getTaxAmount() {
099            return taxAmount;
100        }
101    
102        public void setTaxAmount(KualiDecimal taxAmount) {
103            this.taxAmount = taxAmount;
104        }
105    
106        protected LinkedHashMap toStringMapper() {
107            LinkedHashMap m = new LinkedHashMap();
108            m.put("useTaxId", this.useTaxId);
109            return m;
110        }
111        
112        /**
113         * Override needed for PURAP GL entry creation (hjs) - please do not add "amount" to this method
114         * 
115         * @see java.lang.Object#equals(java.lang.Object)
116         */
117        public boolean equals(Object obj) {
118            if (!(obj instanceof PurApItemUseTaxBase)) {
119                return false;
120            }
121            PurApItemUseTax purapItemUseTax = (PurApItemUseTax) obj;
122            return new EqualsBuilder().append(this.chartOfAccountsCode,purapItemUseTax.getChartOfAccountsCode()).
123            append(this.accountNumber,purapItemUseTax.getAccountNumber()).
124            append(this.getRateCode(),purapItemUseTax.getRateCode()).
125            append(this.financialObjectCode,purapItemUseTax.getFinancialObjectCode()).isEquals();
126        }
127        
128        /**
129         * Override needed for PURAP GL entry creation please do not add "taxAmount" to this method
130         * 
131         * @see java.lang.Object#hashCode()
132         */
133        public int hashCode() {
134            return new HashCodeBuilder(55, 97).
135                append(this.chartOfAccountsCode).
136                append(this.accountNumber).
137                append(this.getRateCode()).
138                append(this.financialObjectCode).toHashCode();
139        }
140        
141    }