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.sys.document;
017    
018    import java.util.List;
019    
020    import org.kuali.kfs.sys.businessobject.AccountingLineParser;
021    import org.kuali.kfs.sys.businessobject.SourceAccountingLine;
022    import org.kuali.kfs.sys.businessobject.TargetAccountingLine;
023    import org.kuali.rice.kns.util.KualiDecimal;
024    
025    /**
026     * This is the FinancialDocument interface. The TransactionalDocument interface should extend this. It represents any document that
027     * exists within the Financial Transactions module, but isn't transactional (i.e. no accounting lines). This interface was put in
028     * place to facilitate the CashManagementDocument which is a Financial Transaction module document, but doesn't have accounting
029     * lines.
030     */
031    public interface AccountingDocument extends GeneralLedgerPostingDocument, GeneralLedgerPendingEntrySource {
032        /**
033         * This method is used to return the title that a transactional document should give to it's source accounting line section.
034         * 
035         * @return The source accounting line section's title.
036         */
037        public String getSourceAccountingLinesSectionTitle();
038    
039        /**
040         * This method is used to return the title that a transactional document should give to it's source accounting line section.
041         * 
042         * @return The target accounting line section's title.
043         */
044        public String getTargetAccountingLinesSectionTitle();
045    
046        /**
047         * Sums up the amounts of all of the target accounting lines.
048         */
049        public KualiDecimal getTargetTotal();
050    
051        /**
052         * Sums up the amounts of all of the source accounting lines.
053         */
054        public KualiDecimal getSourceTotal();
055    
056    
057        /**
058         * @return AccountingLineParser instance appropriate for importing AccountingLines for this document type
059         */
060        public AccountingLineParser getAccountingLineParser();
061    
062        /*
063         * @return Class of the document's source accounting lines
064         */
065        public Class getSourceAccountingLineClass();
066    
067    
068        /*
069         * @return Class of the document's target accounting lines
070         */
071        public Class getTargetAccountingLineClass();
072    
073        /*
074         * @return Name of the document's source accounting lines
075         */
076        public String getSourceAccountingLineEntryName();
077    
078    
079        /*
080         * @return Name of the document's target accounting lines
081         */
082        public String getTargetAccountingLineEntryName();
083    
084        /**
085         * Retrieves the next line sequence number for an accounting line in the Source accounting line section on a transactional
086         * document.
087         * 
088         * @return The next available source line number.
089         */
090        public Integer getNextSourceLineNumber();
091    
092        /**
093         * @param nextLineNumber
094         */
095        public void setNextSourceLineNumber(Integer nextLineNumber);
096    
097        /**
098         * Retrieves the next line sequence number for an accounting line in the Target accounting line section on a transactional
099         * document.
100         * 
101         * @return The next available target line number.
102         */
103        public Integer getNextTargetLineNumber();
104    
105        /**
106         * @param nextLineNumber
107         */
108        public void setNextTargetLineNumber(Integer nextLineNumber);
109    
110        /**
111         * This method adds a source accounting line.
112         * 
113         * @param line
114         */
115        public void addSourceAccountingLine(SourceAccountingLine line);
116    
117        /**
118         * This method returns a list of target accounting lines.
119         * 
120         * @return The list of source accounting lines.
121         */
122        public List getSourceAccountingLines();
123    
124        /**
125         * This method returns the accounting line at a particular spot in the overall list of accounting lines.
126         * 
127         * @param index
128         * @return The source accounting line at the specified index.
129         */
130        public SourceAccountingLine getSourceAccountingLine(int index);
131    
132        /**
133         * This method sets the list of source accounting lines for this document.
134         * 
135         * @param sourceLines
136         */
137        public void setSourceAccountingLines(List sourceLines);
138    
139        /**
140         * This method adds a target accounting line to the document.
141         * 
142         * @param line
143         */
144        public void addTargetAccountingLine(TargetAccountingLine line);
145    
146        /**
147         * This method retrieves all of the target accounting lines associated with this document.
148         */
149        public List getTargetAccountingLines();
150    
151        /**
152         * This method retrieves the target accounting line at the specified index.
153         * 
154         * @param index
155         * @return The target accounting line at the passed in index.
156         */
157        public TargetAccountingLine getTargetAccountingLine(int index);
158    
159        /**
160         * This method sets the list of target accounting lines for this document.
161         * 
162         * @param targetLines
163         */
164        public void setTargetAccountingLines(List targetLines);
165        
166        
167        /**
168         * This method returns the Class to use for AccountingLingValuesAllowedValidation.
169         */
170        public Class<? extends AccountingDocument> getDocumentClassForAccountingLineValueAllowedValidation();
171    
172    }