Source Code Cross Referenced for InternalBillingDocument.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 2005-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.Iterator;
020:        import java.util.List;
021:
022:        import org.kuali.core.document.AmountTotaling;
023:        import org.kuali.core.document.Copyable;
024:        import org.kuali.core.document.Correctable;
025:        import org.kuali.core.util.KualiDecimal;
026:        import org.kuali.kfs.KFSConstants;
027:        import org.kuali.kfs.bo.AccountingLineParser;
028:        import org.kuali.kfs.bo.AccountingLineParserBase;
029:        import org.kuali.kfs.document.AccountingDocumentBase;
030:        import org.kuali.module.financial.bo.InternalBillingItem;
031:
032:        /**
033:         * This is the business object that represents the InternalBillingDocument in Kuali. This is a transactional document that will
034:         * eventually post transactions to the G/L. It integrates with workflow and also contains two groupings of accounting lines: Expense
035:         * and Income.
036:         */
037:        public class InternalBillingDocument extends AccountingDocumentBase
038:                implements  Copyable, Correctable, AmountTotaling {
039:
040:            private List items;
041:            private Integer nextItemLineNumber;
042:
043:            /**
044:             * Initializes the array lists and some basic info.
045:             */
046:            public InternalBillingDocument() {
047:                super ();
048:                setItems(new ArrayList());
049:                this .nextItemLineNumber = new Integer(1);
050:            }
051:
052:            /**
053:             * Adds a new item to the item list.
054:             * 
055:             * @param item
056:             */
057:            public void addItem(InternalBillingItem item) {
058:                item.setItemSequenceId(this .nextItemLineNumber);
059:                this .items.add(item);
060:                this .nextItemLineNumber = new Integer(this .nextItemLineNumber
061:                        .intValue() + 1);
062:            }
063:
064:            /**
065:             * Retrieve a particular item at a given index in the list of items. For Struts, the requested item and any intervening ones are
066:             * initialized if necessary.
067:             * 
068:             * @param index
069:             * @return the item
070:             */
071:            public InternalBillingItem getItem(int index) {
072:                while (getItems().size() <= index) {
073:                    getItems().add(new InternalBillingItem());
074:                }
075:                return (InternalBillingItem) getItems().get(index);
076:            }
077:
078:            /**
079:             * @return Returns the items.
080:             */
081:            public List getItems() {
082:                return items;
083:            }
084:
085:            /**
086:             * Allows items (in addition to accounting lines) to be deleted from the database after being saved there.
087:             * 
088:             * @see org.kuali.core.document.TransactionalDocumentBase#buildListOfDeletionAwareLists()
089:             */
090:            @Override
091:            public List buildListOfDeletionAwareLists() {
092:                List managedLists = super .buildListOfDeletionAwareLists();
093:                managedLists.add(getItems());
094:                return managedLists;
095:            }
096:
097:            /**
098:             * Iterates through the list of items and sums up their totals.
099:             * 
100:             * @return the total
101:             */
102:            public KualiDecimal getItemTotal() {
103:                KualiDecimal total = new KualiDecimal(0);
104:                for (Iterator iterator = items.iterator(); iterator.hasNext();) {
105:                    total = total.add(((InternalBillingItem) iterator.next())
106:                            .getTotal());
107:                }
108:                return total;
109:            }
110:
111:            /**
112:             * Retrieves the next item line number.
113:             * 
114:             * @return The next available item line number
115:             */
116:            public Integer getNextItemLineNumber() {
117:                return this .nextItemLineNumber;
118:            }
119:
120:            /**
121:             * @param items
122:             */
123:            public void setItems(List items) {
124:                this .items = items;
125:            }
126:
127:            /**
128:             * Setter for OJB to get from database and JSP to maintain state in hidden fields. This property is also incremented by the
129:             * <code>addItem</code> method.
130:             * 
131:             * @param nextItemLineNumber
132:             */
133:            public void setNextItemLineNumber(Integer nextItemLineNumber) {
134:                this .nextItemLineNumber = nextItemLineNumber;
135:            }
136:
137:            /**
138:             * @return "Income"
139:             */
140:            @Override
141:            public String getSourceAccountingLinesSectionTitle() {
142:                return KFSConstants.INCOME;
143:            }
144:
145:            /**
146:             * @return "Expense"
147:             */
148:            @Override
149:            public String getTargetAccountingLinesSectionTitle() {
150:                return KFSConstants.EXPENSE;
151:            }
152:
153:            /**
154:             * @see org.kuali.kfs.document.AccountingDocumentBase#getAccountingLineParser()
155:             */
156:            @Override
157:            public AccountingLineParser getAccountingLineParser() {
158:                return new AccountingLineParserBase();
159:            }
160:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.