1 /*
2 * Copyright 2007 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.ole.sys.document;
17
18 import java.sql.Date;
19 import java.util.List;
20
21 import org.kuali.ole.sys.businessobject.AccountingLineParser;
22 import org.kuali.ole.sys.businessobject.SourceAccountingLine;
23 import org.kuali.ole.sys.businessobject.TargetAccountingLine;
24 import org.kuali.rice.core.api.util.type.KualiDecimal;
25
26 /**
27 * This is the FinancialDocument interface. The TransactionalDocument interface should extend this. It represents any document that
28 * exists within the Financial Transactions module, but isn't transactional (i.e. no accounting lines). This interface was put in
29 * place to facilitate the CashManagementDocument which is a Financial Transaction module document, but doesn't have accounting
30 * lines.
31 */
32 public interface AccountingDocument extends GeneralLedgerPostingDocument, GeneralLedgerPendingEntrySource {
33 /**
34 * This method is used to return the title that a transactional document should give to it's source accounting line section.
35 *
36 * @return The source accounting line section's title.
37 */
38 public String getSourceAccountingLinesSectionTitle();
39
40 /**
41 * This method is used to return the title that a transactional document should give to it's source accounting line section.
42 *
43 * @return The target accounting line section's title.
44 */
45 public String getTargetAccountingLinesSectionTitle();
46
47 /**
48 * Sums up the amounts of all of the target accounting lines.
49 */
50 public KualiDecimal getTargetTotal();
51
52 /**
53 * Sums up the amounts of all of the source accounting lines.
54 */
55 public KualiDecimal getSourceTotal();
56
57
58 /**
59 * @return AccountingLineParser instance appropriate for importing AccountingLines for this document type
60 */
61 public AccountingLineParser getAccountingLineParser();
62
63 /*
64 * @return Class of the document's source accounting lines
65 */
66 public Class getSourceAccountingLineClass();
67
68
69 /*
70 * @return Class of the document's target accounting lines
71 */
72 public Class getTargetAccountingLineClass();
73
74 /*
75 * @return Name of the document's source accounting lines
76 */
77 public String getSourceAccountingLineEntryName();
78
79
80 /*
81 * @return Name of the document's target accounting lines
82 */
83 public String getTargetAccountingLineEntryName();
84
85 /**
86 * Retrieves the next line sequence number for an accounting line in the Source accounting line section on a transactional
87 * document.
88 *
89 * @return The next available source line number.
90 */
91 public Integer getNextSourceLineNumber();
92
93 /**
94 * @param nextLineNumber
95 */
96 public void setNextSourceLineNumber(Integer nextLineNumber);
97
98 /**
99 * Retrieves the next line sequence number for an accounting line in the Target accounting line section on a transactional
100 * document.
101 *
102 * @return The next available target line number.
103 */
104 public Integer getNextTargetLineNumber();
105
106 /**
107 * @param nextLineNumber
108 */
109 public void setNextTargetLineNumber(Integer nextLineNumber);
110
111 /**
112 * This method adds a source accounting line.
113 *
114 * @param line
115 */
116 public void addSourceAccountingLine(SourceAccountingLine line);
117
118 /**
119 * This method returns a list of target accounting lines.
120 *
121 * @return The list of source accounting lines.
122 */
123 public List getSourceAccountingLines();
124
125 /**
126 * This method returns the accounting line at a particular spot in the overall list of accounting lines.
127 *
128 * @param index
129 * @return The source accounting line at the specified index.
130 */
131 public SourceAccountingLine getSourceAccountingLine(int index);
132
133 /**
134 * This method sets the list of source accounting lines for this document.
135 *
136 * @param sourceLines
137 */
138 public void setSourceAccountingLines(List sourceLines);
139
140 /**
141 * This method adds a target accounting line to the document.
142 *
143 * @param line
144 */
145 public void addTargetAccountingLine(TargetAccountingLine line);
146
147 /**
148 * This method retrieves all of the target accounting lines associated with this document.
149 */
150 public List getTargetAccountingLines();
151
152 /**
153 * This method retrieves the target accounting line at the specified index.
154 *
155 * @param index
156 * @return The target accounting line at the passed in index.
157 */
158 public TargetAccountingLine getTargetAccountingLine(int index);
159
160 /**
161 * This method sets the list of target accounting lines for this document.
162 *
163 * @param targetLines
164 */
165 public void setTargetAccountingLines(List targetLines);
166
167
168 /**
169 * This method returns the Class to use for AccountingLingValuesAllowedValidation.
170 */
171 public Class<? extends AccountingDocument> getDocumentClassForAccountingLineValueAllowedValidation();
172
173 /**
174 *This method check the document status to determine whether the document is final/processed or not.
175 *@return true if documentFinalOrProcessed otherwise false
176 */
177 public boolean isDocumentFinalOrProcessed();
178 }