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    import java.math.BigDecimal;
019    
020    import org.kuali.kfs.sys.businessobject.AccountingLine;
021    import org.kuali.kfs.sys.businessobject.SourceAccountingLine;
022    import org.kuali.rice.kns.util.KualiDecimal;
023    
024    /**
025     * Purap Accounting Line Interface.
026     */
027    public interface PurApAccountingLine extends AccountingLine {
028    
029        public abstract Integer getAccountIdentifier();
030    
031        public abstract void setAccountIdentifier(Integer accountIdentifier);
032    
033        public abstract Integer getItemIdentifier();
034    
035        public abstract void setItemIdentifier(Integer itemIdentifier);
036    
037        public abstract BigDecimal getAccountLinePercent();
038    
039        public abstract void setAccountLinePercent(BigDecimal accountLinePercent);
040    
041        /**
042         * Determines if the current purap accounting line is in an empty state.
043         * 
044         * @return boolean - true if empty state
045         */
046        public abstract boolean isEmpty();
047    
048        /**
049         * Creates a copy of the current purap accounting line and sets the percentage and the amount to zero.
050         * 
051         * @return - purap accounting line copy with blank percent and amount
052         */
053        public abstract PurApAccountingLine createBlankAmountsCopy();
054    
055        /**
056         * Compares the current accounting line values with a source accounting line to see if both accounting lines are equal.
057         * 
058         * @param accountingLine - accounting line to compare
059         * @return boolean - true if passed in and current accounting line are equal, false otherwise
060         */
061        public abstract boolean accountStringsAreEqual(SourceAccountingLine accountingLine);
062    
063        /**
064         * Compares the current accounting line values with a purap accounting line to see if both accounting lines are equal.
065         * 
066         * @param accountingLine - accounting line to compare
067         * @return boolean - true if passed in and current accounting line are equal, false otherwise
068         */
069        public abstract boolean accountStringsAreEqual(PurApAccountingLine accountingLine);
070    
071        /**
072         * Creates a source accounting line from the current purap accounting line.
073         * 
074         * @return - source accounting line based on current purap accounting line
075         */
076        public abstract SourceAccountingLine generateSourceAccountingLine();
077    
078        public KualiDecimal getAlternateAmountForGLEntryCreation();
079    
080        public void setAlternateAmountForGLEntryCreation(KualiDecimal alternateAmountForGLEntryCreation);
081    
082        public <T extends PurApItem> T getPurapItem();
083       
084        public void setPurapItem(PurApItem item);
085        
086        public String getString();
087    
088        public String getPostingPeriodCode();
089    
090        public void setPostingPeriodCode(String postingPeriodCode);
091        
092    }