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.businessobject;
017    
018    import java.util.Map;
019    
020    import org.kuali.kfs.coa.businessobject.Account;
021    import org.kuali.kfs.coa.businessobject.BalanceType;
022    import org.kuali.kfs.coa.businessobject.Chart;
023    import org.kuali.kfs.coa.businessobject.ObjectCode;
024    import org.kuali.kfs.coa.businessobject.ObjectType;
025    import org.kuali.kfs.coa.businessobject.ProjectCode;
026    import org.kuali.kfs.coa.businessobject.SubAccount;
027    import org.kuali.kfs.coa.businessobject.SubObjectCode;
028    import org.kuali.kfs.fp.businessobject.SalesTax;
029    import org.kuali.rice.kew.doctype.bo.DocumentTypeEBO;
030    import org.kuali.rice.kns.bo.PersistableBusinessObject;
031    import org.kuali.rice.kns.util.KualiDecimal;
032    
033    /**
034     * An AccountLine contains all the accounting items typically necessary to create a pending entry to the G/L. All transaction
035     * documents will use this business object inherently. Specific accounting line business rules should exist not in this
036     * implementation, but rather in the document business object that uses it.
037     */
038    public interface AccountingLine extends PersistableBusinessObject, GeneralLedgerPendingEntrySourceDetail {
039    
040        /**
041         * @param account The account to set.
042         * @deprecated
043         */
044        public void setAccount(Account account);
045    
046        /**
047         * @return Returns the chartOfAccountsCode.
048         */
049        public Chart getChart();
050    
051        /**
052         * @param chart The chartOfAccountsCode to set.
053         * @deprecated
054         */
055        public void setChart(Chart chart);
056    
057        /**
058         * @param amount The amount to set.
059         */
060        public void setAmount(KualiDecimal amount);
061    
062        /**
063         * @return Returns the balanceTyp.
064         */
065        public BalanceType getBalanceTyp();
066    
067        /**
068         * @param balanceTyp The balanceTyp to set.
069         * @deprecated
070         */
071        public void setBalanceTyp(BalanceType balanceTyp);
072    
073        /**
074         * @param objectCode The objectCode to set.
075         * @deprecated
076         */
077        public void setObjectCode(ObjectCode objectCode);
078    
079        /**
080         * @param originCode The referenceOriginCode to set.
081         */
082        public void setReferenceOriginCode(String originCode);
083    
084        /**
085         * This method returns the object related to referenceOriginCode
086         * 
087         * @return referenceOrigin
088         */
089        public OriginationCode getReferenceOrigin();
090    
091        /**
092         * This method sets the referenceOrigin object, this is only to be used by OJB
093         * 
094         * @param referenceOrigin
095         * @deprecated
096         */
097        public void setReferenceOrigin(OriginationCode referenceOrigin);
098    
099        /**
100         * Gets the referenceFinancialSystemDocumentTypeCode attribute.
101         *  
102         * @return Returns the referenceFinancialSystemDocumentTypeCode.
103         */
104        public DocumentTypeEBO getReferenceFinancialSystemDocumentTypeCode();
105    
106        /**
107         * @param organizationReferenceId The organizationReferenceId to set.
108         */
109        public void setOrganizationReferenceId(String organizationReferenceId);
110    
111        /**
112         * @return Returns the overrideCode.
113         */
114        public String getOverrideCode();
115    
116        /**
117         * @param overrideCode The overrideCode to set.
118         */
119        public void setOverrideCode(String overrideCode);
120    
121        /**
122         * @param postingYear The postingYear to set.
123         */
124        public void setPostingYear(Integer postingYear);
125    
126        /**
127         * @param projectCode The projectCode to set.
128         */
129        public void setProjectCode(String projectCode);
130    
131        /**
132         * @param referenceNumber The referenceNumber to set.
133         */
134        public void setReferenceNumber(String referenceNumber);
135    
136        /**
137         * @param referenceTypeCode The referenceTypeCode to set.
138         */
139        public void setReferenceTypeCode(String referenceTypeCode);
140    
141        /**
142         * @return Returns the sequenceNumber.
143         */
144        public Integer getSequenceNumber();
145    
146        /**
147         * @param sequenceNumber The sequenceNumber to set.
148         */
149        public void setSequenceNumber(Integer sequenceNumber);
150    
151        /**
152         * @return Returns the subAccount.
153         */
154        public SubAccount getSubAccount();
155    
156        /**
157         * @param subAccount The subAccount to set.
158         * @deprecated
159         */
160        public void setSubAccount(SubAccount subAccount);
161    
162        /**
163         * @return Returns the subObjectCode.
164         */
165        public SubObjectCode getSubObjectCode();
166    
167        /**
168         * @param subObjectCode The subObjectCode to set.
169         * @deprecated
170         */
171        public void setSubObjectCode(SubObjectCode subObjectCode);
172    
173        /**
174         * @param documentNumber The documentNumber to set.
175         */
176        public void setDocumentNumber(String documentNumber);
177    
178        /**
179         * This method retrieves the debit/credit code for the accounting line. This method will only return a not null value for a
180         * Journal Voucher document.
181         * 
182         * @return A String code.
183         */
184        public String getDebitCreditCode();
185    
186        /**
187         * This method sets the debit/credit code for the accounting line. This method should only be used for a Journal Voucher
188         * document.
189         * 
190         * @param debitCreditCode
191         */
192        public void setDebitCreditCode(String debitCreditCode);
193    
194        /**
195         * This method retrieves the encumbrance update code for the accounting line. This method will only return a not null value for
196         * a Journal Voucher document.
197         * 
198         * @return A String code.
199         */
200        public String getEncumbranceUpdateCode();
201    
202        /**
203         * This method sets the debit/credit code for the accounting line. This method should only be used for a Journal Voucher
204         * document.
205         * 
206         * @param encumbranceUpdateCode
207         */
208        public void setEncumbranceUpdateCode(String encumbranceUpdateCode);
209    
210        /**
211         * This method retrieves the ObjectType for the accounting line. This method will only return a not null value for a Journal
212         * Voucher document.
213         * 
214         * @return An ObjectType instance.
215         */
216        public ObjectType getObjectType();
217    
218        /**
219         * @param accountNumber The accountNumber to set.
220         */
221        public void setAccountNumber(String accountNumber);
222    
223        /**
224         * @param balanceTypeCode The balanceTypeCode to set.
225         */
226        public void setBalanceTypeCode(String balanceTypeCode);
227    
228        /**
229         * @param chartOfAccountsCode The chartOfAccountsCode to set.
230         */
231        public void setChartOfAccountsCode(String chartOfAccountsCode);
232    
233        /**
234         * @param financialObjectCode The financialObjectCode to set.
235         */
236        public void setFinancialObjectCode(String financialObjectCode);
237    
238        /**
239         * @param financialSubObjectCode The financialSubObjectCode to set.
240         */
241        public void setFinancialSubObjectCode(String financialSubObjectCode);
242    
243        /**
244         * @return Returns the objectTypeCode.
245         */
246        public String getObjectTypeCode();
247    
248        /**
249         * @return Returns the financialDocumentLineTypeCode.
250         */
251        public String getFinancialDocumentLineTypeCode();
252    
253        /**
254         * @param financialDocumentLineTypeCode The financialDocumentLineTypeCode to set.
255         */
256        public void setFinancialDocumentLineTypeCode(String financialDocumentLineTypeCode);
257    
258        /**
259         * @return Returns the project.
260         */
261        public ProjectCode getProject();
262    
263        /**
264         * @param project The project to set.
265         * @deprecated
266         */
267        public void setProject(ProjectCode project);
268    
269        /**
270         * @param subAccountNumber The subAccountNumber to set.
271         */
272        public void setSubAccountNumber(String subAccountNumber);
273    
274        /**
275         * @param financialDocumentLineDescription The financialDocumentLineDescription to set.
276         */
277        public abstract void setFinancialDocumentLineDescription(String financialDocumentLineDescription);
278    
279        /**
280         * @return the sales tax associated with this line if any
281         */
282        public abstract SalesTax getSalesTax();
283    
284        /**
285         * @param salesTax The sales tax associated with this AccountingLine
286         */
287        public abstract void setSalesTax(SalesTax salesTax);
288    
289        /**
290         * This method checks to see if sales tax is required for this accounting line or not
291         * 
292         * @return true if it is required, false otherwise
293         */
294        public boolean isSalesTaxRequired();
295    
296        /**
297         * You can set whether or not sales tax is required for this accounting line or not
298         * 
299         * @param salesTaxRequired - true if required
300         */
301        public void setSalesTaxRequired(boolean salesTaxRequired);
302    
303        /**
304         * @see org.kuali.rice.kns.bo.AccountingLine#isSourceAccountingLine()
305         */
306        public boolean isSourceAccountingLine();
307    
308        /**
309         * @see org.kuali.rice.kns.bo.AccountingLine#isTargetAccountingLine()
310         */
311        public boolean isTargetAccountingLine();
312    
313        /**
314         * @param other
315         * @return true if this AccountingLine has the same primitive field values as the given one
316         */
317        public boolean isLike(AccountingLine other);
318    
319        /**
320         * Overwrites the fields of this AccountingLine with the values of the corresponding fields of the given AccountingLine.
321         * Reference field values are in this instance are overwritten with deepCopies of the reference fields of the given
322         * AccountingLine.
323         * 
324         * @param other
325         */
326        public void copyFrom(AccountingLine other);
327    
328        /**
329         * Convenience method to make the primitive account fields from this AccountingLine easier to compare to the account fields of
330         * another AccountingLine or of an Account
331         * 
332         * @return String representing the account associated with this AccountingLine
333         */
334        public String getAccountKey();
335    
336        /**
337         * This indicates the account expired component of this AccountingLine's overrideCode. It provides a DataDictionary attribute
338         * for the UI, but is not persisted itself.
339         * 
340         * @return accountExpiredOverride
341         */
342        boolean getAccountExpiredOverride();
343    
344        /**
345         * @see #getAccountExpiredOverride()
346         * @param b the accountExpiredOverride to set
347         */
348        public void setAccountExpiredOverride(boolean b);
349    
350        /**
351         * This indicates the account expired override is needed (because this AccountingLine's Account is expired). It tells the UI to
352         * display the accountExpiredOverride attribute, but is not persisted itself.
353         * 
354         * @return accountExpiredOverride
355         */
356        public boolean getAccountExpiredOverrideNeeded();
357    
358        /**
359         * @see #getAccountExpiredOverrideNeeded()
360         * @param b the accountExpiredOverrideNeeded to set
361         */
362        public void setAccountExpiredOverrideNeeded(boolean b);
363    
364        /**
365         * This indicates the object budget component of this AccountingLine's overrideCode. It provides a DataDictionary attribute for
366         * the UI, but is not persisted itself.
367         * 
368         * @return objectBudgetOverride
369         */
370        public boolean isObjectBudgetOverride();
371    
372        /**
373         * @see #isObjectBudgetOverride()
374         * @param b the objectBudgetOverride to set
375         */
376        public void setObjectBudgetOverride(boolean b);
377    
378        /**
379         * This indicates the object budget override is needed (because this AccountingLine's Account is expired). It tells the UI to
380         * display the objectBudgetOverride attribute, but is not persisted itself.
381         * 
382         * @return boolean
383         */
384        public boolean isObjectBudgetOverrideNeeded();
385    
386        /**
387         * @see #isObjectBudgetOverrideNeeded()
388         * @param b the objectBudgetOverride to set
389         */
390        public void setObjectBudgetOverrideNeeded(boolean b);
391    
392        /**
393         * Gets the nonFringeAccountOverride attribute.
394         * 
395         * @return Returns the nonFringeAccountOverride.
396         */
397        public boolean getNonFringeAccountOverride();
398    
399        /**
400         * Sets the nonFringeAccountOverride attribute value.
401         * 
402         * @param nonFringeAccountOverride The nonFringeAccountOverride to set.
403         */
404        public void setNonFringeAccountOverride(boolean nonFringeAccountOverride);
405    
406        /**
407         * Gets the nonFringeAccountOverrideNeeded attribute.
408         * 
409         * @return Returns the nonFringeAccountOverrideNeeded.
410         */
411        public boolean getNonFringeAccountOverrideNeeded();
412    
413        /**
414         * Sets the nonFringeAccountOverrideNeeded attribute value.
415         * 
416         * @param nonFringeAccountOverrideNeeded The nonFringeAccountOverrideNeeded to set.
417         */
418        public void setNonFringeAccountOverrideNeeded(boolean nonFringeAccountOverrideNeeded);
419    
420        /**
421         * Returns a Map with the accounting line primitive field names as the key of the map and the primitive values as the value.
422         * 
423         * @return Map
424         */
425        public Map getValuesMap();
426    }