001/*
002 * Copyright 2007 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 */
016package org.kuali.ole.module.purap.businessobject;
017
018import org.kuali.ole.sys.businessobject.AccountingLine;
019import org.kuali.ole.sys.businessobject.SourceAccountingLine;
020import org.kuali.rice.core.api.util.type.KualiDecimal;
021
022import java.math.BigDecimal;
023
024/**
025 * Purap Accounting Line Interface.
026 */
027public 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    public abstract Integer getSequenceNumber();
042
043    public abstract void setSequenceNumber(Integer sequenceNumber);
044
045    public abstract Integer getPurApSequenceNumber();
046
047    /**
048     * Determines if the current purap accounting line is in an empty state.
049     *
050     * @return boolean - true if empty state
051     */
052    public abstract boolean isEmpty();
053
054    /**
055     * Creates a copy of the current purap accounting line and sets the percentage and the amount to zero.
056     *
057     * @return - purap accounting line copy with blank percent and amount
058     */
059    public abstract PurApAccountingLine createBlankAmountsCopy();
060
061    /**
062     * Compares the current accounting line values with a source accounting line to see if both accounting lines are equal.
063     *
064     * @param accountingLine - accounting line to compare
065     * @return boolean - true if passed in and current accounting line are equal, false otherwise
066     */
067    public abstract boolean accountStringsAreEqual(SourceAccountingLine accountingLine);
068
069    /**
070     * Compares the current accounting line values with a purap accounting line to see if both accounting lines are equal.
071     *
072     * @param accountingLine - accounting line to compare
073     * @return boolean - true if passed in and current accounting line are equal, false otherwise
074     */
075    public abstract boolean accountStringsAreEqual(PurApAccountingLine accountingLine);
076
077    /**
078     * Creates a source accounting line from the current purap accounting line.
079     *
080     * @return - source accounting line based on current purap accounting line
081     */
082    public abstract SourceAccountingLine generateSourceAccountingLine();
083
084    public KualiDecimal getAlternateAmountForGLEntryCreation();
085
086    public void setAlternateAmountForGLEntryCreation(KualiDecimal alternateAmountForGLEntryCreation);
087
088    public <T extends PurApItem> T getPurapItem();
089
090    public void setPurapItem(PurApItem item);
091
092    public String getString();
093
094    public String getPostingPeriodCode();
095
096    public void setPostingPeriodCode(String postingPeriodCode);
097
098}