Source Code Cross Referenced for AdvanceDepositDocument.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » financial » document » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ERP CRM Financial » Kuali Financial System » org.kuali.module.financial.document 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2006-2007 The Kuali Foundation.
003:         * 
004:         * Licensed under the Educational Community License, Version 1.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/ecl1.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.module.financial.document;
017:
018:        import java.util.ArrayList;
019:        import java.util.List;
020:
021:        import org.kuali.core.document.AmountTotaling;
022:        import org.kuali.core.document.Copyable;
023:        import org.kuali.core.service.DocumentTypeService;
024:        import org.kuali.core.util.KualiDecimal;
025:        import org.kuali.core.web.format.CurrencyFormatter;
026:        import org.kuali.kfs.KFSConstants;
027:        import org.kuali.kfs.context.SpringContext;
028:        import org.kuali.module.financial.bo.AdvanceDepositDetail;
029:
030:        /**
031:         * This is the business object that represents the AdvanceDeposit document in Kuali. This is a transactional document that will
032:         * eventually post transactions to the G/L. It integrates with workflow. Since an Advance Deposit document is a one sided
033:         * transactional document, only accepting funds into the university, the accounting line data will be held in the source accounting
034:         * line data structure only.
035:         */
036:        public class AdvanceDepositDocument extends CashReceiptFamilyBase
037:                implements  Copyable, AmountTotaling {
038:            // holds details about each advance deposit
039:            private List<AdvanceDepositDetail> advanceDeposits = new ArrayList<AdvanceDepositDetail>();
040:
041:            // incrementers for detail lines
042:            private Integer nextAdvanceDepositLineNumber = 1;
043:
044:            // monetary attributes
045:            private KualiDecimal totalAdvanceDepositAmount = KualiDecimal.ZERO;
046:
047:            /**
048:             * Default constructor that calls super.
049:             */
050:            public AdvanceDepositDocument() {
051:                super ();
052:            }
053:
054:            /**
055:             * Gets the total advance deposit amount.
056:             * 
057:             * @return KualiDecimal
058:             */
059:            public KualiDecimal getTotalAdvanceDepositAmount() {
060:                return totalAdvanceDepositAmount;
061:            }
062:
063:            /**
064:             * This method returns the advance deposit total amount as a currency formatted string.
065:             * 
066:             * @return String
067:             */
068:            public String getCurrencyFormattedTotalAdvanceDepositAmount() {
069:                return (String) new CurrencyFormatter()
070:                        .format(totalAdvanceDepositAmount);
071:            }
072:
073:            /**
074:             * Sets the total advance deposit amount which is the sum of all advance deposits on this document.
075:             * 
076:             * @param advanceDepositAmount
077:             */
078:            public void setTotalAdvanceDepositAmount(
079:                    KualiDecimal advanceDepositAmount) {
080:                this .totalAdvanceDepositAmount = advanceDepositAmount;
081:            }
082:
083:            /**
084:             * Gets the list of advance deposits which is a list of AdvanceDepositDetail business objects.
085:             * 
086:             * @return List
087:             */
088:            public List<AdvanceDepositDetail> getAdvanceDeposits() {
089:                return advanceDeposits;
090:            }
091:
092:            /**
093:             * Sets the advance deposits list.
094:             * 
095:             * @param advanceDeposits
096:             */
097:            public void setAdvanceDeposits(
098:                    List<AdvanceDepositDetail> advanceDeposits) {
099:                this .advanceDeposits = advanceDeposits;
100:            }
101:
102:            /**
103:             * Adds a new advance deposit to the list.
104:             * 
105:             * @param advanceDepositDetail
106:             */
107:            public void addAdvanceDeposit(
108:                    AdvanceDepositDetail advanceDepositDetail) {
109:                // these three make up the primary key for an advance deposit detail record
110:                prepareNewAdvanceDeposit(advanceDepositDetail);
111:
112:                // add the new detail record to the list
113:                this .advanceDeposits.add(advanceDepositDetail);
114:
115:                // increment line number
116:                this .nextAdvanceDepositLineNumber++;
117:
118:                // update the overall amount
119:                this .totalAdvanceDepositAmount = this .totalAdvanceDepositAmount
120:                        .add(advanceDepositDetail
121:                                .getFinancialDocumentAdvanceDepositAmount());
122:            }
123:
124:            /**
125:             * This is a helper method that automatically populates document specfic information into the advance deposit
126:             * (AdvanceDepositDetail) instance.
127:             * 
128:             * @param advanceDepositDetail
129:             */
130:            public final void prepareNewAdvanceDeposit(
131:                    AdvanceDepositDetail advanceDepositDetail) {
132:                advanceDepositDetail
133:                        .setFinancialDocumentLineNumber(this .nextAdvanceDepositLineNumber);
134:                advanceDepositDetail
135:                        .setFinancialDocumentColumnTypeCode(KFSConstants.AdvanceDepositConstants.CASH_RECEIPT_ADVANCE_DEPOSIT_COLUMN_TYPE_CODE);
136:                advanceDepositDetail
137:                        .setDocumentNumber(this .getDocumentNumber());
138:                advanceDepositDetail.setFinancialDocumentTypeCode(SpringContext
139:                        .getBean(DocumentTypeService.class)
140:                        .getDocumentTypeCodeByClass(this .getClass()));
141:            }
142:
143:            /**
144:             * Retrieve a particular advance deposit at a given index in the list of advance deposits.
145:             * 
146:             * @param index
147:             * @return AdvanceDepositDetail
148:             */
149:            public AdvanceDepositDetail getAdvanceDepositDetail(int index) {
150:                while (this .advanceDeposits.size() <= index) {
151:                    advanceDeposits.add(new AdvanceDepositDetail());
152:                }
153:                return advanceDeposits.get(index);
154:            }
155:
156:            /**
157:             * This method removes an advance deposit from the list and updates the total appropriately.
158:             * 
159:             * @param index
160:             */
161:            public void removeAdvanceDeposit(int index) {
162:                AdvanceDepositDetail advanceDepositDetail = advanceDeposits
163:                        .remove(index);
164:                this .totalAdvanceDepositAmount = this .totalAdvanceDepositAmount
165:                        .subtract(advanceDepositDetail
166:                                .getFinancialDocumentAdvanceDepositAmount());
167:            }
168:
169:            /**
170:             * @return Integer
171:             */
172:            public Integer getNextAdvanceDepositLineNumber() {
173:                return nextAdvanceDepositLineNumber;
174:            }
175:
176:            /**
177:             * @param nextAdvanceDepositLineNumber
178:             */
179:            public void setNextAdvanceDepositLineNumber(
180:                    Integer nextAdvanceDepositLineNumber) {
181:                this .nextAdvanceDepositLineNumber = nextAdvanceDepositLineNumber;
182:            }
183:
184:            /**
185:             * This method returns the overall total of the document - the advance deposit total.
186:             * 
187:             * @see org.kuali.kfs.document.AccountingDocumentBase#getTotalDollarAmount()
188:             * @return KualiDecimal
189:             */
190:            @Override
191:            public KualiDecimal getTotalDollarAmount() {
192:                return this .totalAdvanceDepositAmount;
193:            }
194:
195:            /**
196:             * Overrides super to call super and then also add in the new list of advance deposits that have to be managed.
197:             * 
198:             * @see org.kuali.core.document.TransactionalDocumentBase#buildListOfDeletionAwareLists()
199:             */
200:            @Override
201:            public List buildListOfDeletionAwareLists() {
202:                List managedLists = super.buildListOfDeletionAwareLists();
203:                managedLists.add(getAdvanceDeposits());
204:
205:                return managedLists;
206:            }
207:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.