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.endow.document;
017
018 import java.util.List;
019
020 import org.kuali.kfs.module.endow.businessobject.EndowmentSourceTransactionLine;
021 import org.kuali.kfs.module.endow.businessobject.EndowmentTargetTransactionLine;
022 import org.kuali.kfs.module.endow.businessobject.EndowmentTransactionLine;
023 import org.kuali.kfs.module.endow.businessobject.EndowmentTransactionLineParser;
024 import org.kuali.kfs.module.endow.util.LineParser;
025 import org.kuali.rice.kns.util.KualiDecimal;
026
027
028 public interface EndowmentTransactionLinesDocument extends EndowmentTransactionalDocument {
029
030 /**
031 * This method is used to return the title that a transactional document should give to it's source transaction line section.
032 *
033 * @return The source transaction line section's title.
034 */
035 public String getSourceTransactionLinesSectionTitle();
036
037 /**
038 * This method is used to return the title that a transactional document should give to it's target transaction line section.
039 *
040 * @return The target transaction line section's title.
041 */
042 public String getTargetTransactionLinesSectionTitle();
043
044 /**
045 * Sums up the amounts of all of the target transaction lines for income.
046 */
047 public KualiDecimal getTargetIncomeTotal();
048
049 /**
050 * Sums up the amounts of all of the target transaction lines for principal.
051 */
052 public KualiDecimal getTargetPrincipalTotal();
053
054 /**
055 * Sums up the amounts of all of the source transaction lines for income.
056 */
057 public KualiDecimal getSourceIncomeTotal();
058
059 /**
060 * Sums up the amounts of all of the source transaction lines for principal.
061 */
062 public KualiDecimal getSourcePrincipalTotal();
063
064 /**
065 * Sums up the units of all the source transaction lines for income.
066 *
067 * @return the total income units
068 */
069 public KualiDecimal getSourceIncomeTotalUnits();
070
071 /**
072 * Sums up the units of all source transaction lines for principal.
073 *
074 * @return the total principal units
075 */
076 public KualiDecimal getSourcePrincipalTotalUnits();
077
078 /**
079 * Sums up the units of all the target transaction lines for income.
080 *
081 * @return the total income units
082 */
083 public KualiDecimal getTargetIncomeTotalUnits();
084
085 /**
086 * Sums up the units of all source transaction lines for principal.
087 *
088 * @return the total principal units
089 */
090 public KualiDecimal getTargetPrincipalTotalUnits();
091
092 /**
093 * Compute the total amount for the target transaction lines.
094 *
095 * @return the total amount for the target transaction lines
096 */
097 public KualiDecimal getTargetTotalAmount();
098
099 /**
100 * Compute the total amount for the source transaction lines.
101 *
102 * @return the total amount for the source transaction lines
103 */
104 public KualiDecimal getSourceTotalAmount();
105
106 /**
107 * Computes the total units for the source transaction lines.
108 *
109 * @return the total units for the source transaction lines
110 */
111 public KualiDecimal getSourceTotalUnits();
112
113 /**
114 * Computes the total units for the target transaction lines.
115 *
116 * @return the total units for the target transaction lines
117 */
118 public KualiDecimal getTargetTotalUnits();
119
120 /**
121 * Base implementation to compute the document total units. Documents that display the total units will implement the
122 * UnitsTotaling interface and can override this method if needed.
123 *
124 * @return the total units for the document
125 */
126 public KualiDecimal getTotalUnits();
127
128 /**
129 * @return TransactionLineParser instance appropriate for importing TransactionLines for this document type
130 */
131 public EndowmentTransactionLineParser getTransactionLineParser();
132
133
134 /**
135 * Retrieves the next line sequence number for a transaction line in the Source transaction line section on an endowment
136 * transactional document.
137 *
138 * @return The next available source line number.
139 */
140 public Integer getNextSourceLineNumber();
141
142 /**
143 * @param nextLineNumber
144 */
145 public void setNextSourceLineNumber(Integer nextLineNumber);
146
147 /**
148 * Retrieves the next line sequence number for an transaction line in the Target transaction line section on an endowment
149 * transactional document.
150 *
151 * @return The next available target line number.
152 */
153 public Integer getNextTargetLineNumber();
154
155 /**
156 * @param nextLineNumber
157 */
158 public void setNextTargetLineNumber(Integer nextLineNumber);
159
160 /**
161 * This method adds a source transaction line.
162 *
163 * @param line
164 */
165 public void addSourceTransactionLine(EndowmentSourceTransactionLine line);
166
167 /**
168 * This method returns a list of source transaction lines.
169 *
170 * @return The list of source transaction lines.
171 */
172 public List<EndowmentTransactionLine> getSourceTransactionLines();
173
174 /**
175 * This method sets the list of source transaction lines for this document.
176 *
177 * @param sourceLines
178 */
179 public void setSourceTransactionLines(List<EndowmentTransactionLine> sourceLines);
180
181 /**
182 * This method adds a target transaction line to the document.
183 *
184 * @param line
185 */
186 public void addTargetTransactionLine(EndowmentTargetTransactionLine line);
187
188 /**
189 * This method retrieves all of the target transaction lines associated with this document.
190 */
191 public List<EndowmentTransactionLine> getTargetTransactionLines();
192
193 /**
194 * This method sets the list of target transaction lines for this document.
195 *
196 * @param targetLines
197 */
198 public void setTargetTransactionLines(List<EndowmentTransactionLine> targetLines);
199
200 /**
201 * This method returns the transaction line at a particular spot in the overall list of transaction lines.
202 *
203 * @param index
204 * @return The source transaction line at the specified index.
205 */
206 public EndowmentSourceTransactionLine getSourceTransactionLine(int index);
207
208 /**
209 * This method retrieves the target transaction line at the specified index.
210 *
211 * @param index
212 * @return The target transaction line at the passed in index.
213 */
214 public EndowmentTargetTransactionLine getTargetTransactionLine(int index);
215
216 public Class getTranLineClass(boolean isSource);
217
218 public LineParser getLineParser();
219 }