Source Code Cross Referenced for SufficientFundsItem.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » util » 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.gl.util 
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.gl.util;
017:
018:        import java.io.Serializable;
019:
020:        import org.kuali.core.util.KualiDecimal;
021:        import org.kuali.kfs.KFSConstants;
022:        import org.kuali.kfs.bo.AccountingLine;
023:        import org.kuali.kfs.bo.Options;
024:        import org.kuali.module.chart.bo.Account;
025:        import org.kuali.module.chart.bo.ObjectCode;
026:        import org.kuali.module.chart.bo.ObjectType;
027:        import org.kuali.module.chart.bo.codes.BalanceTyp;
028:        import org.kuali.module.gl.bo.Transaction;
029:
030:        /**
031:         * Represents a sufficient fund item which is used to show if a document has sufficient funds
032:         */
033:        public class SufficientFundsItem implements  Serializable, Comparable {
034:            private Options year;
035:            private Account account;
036:            private ObjectCode financialObject;
037:            private ObjectType financialObjectType;
038:            private String sufficientFundsObjectCode;
039:            private KualiDecimal amount;
040:            private String documentTypeCode;
041:            private BalanceTyp balanceTyp;
042:
043:            public BalanceTyp getBalanceTyp() {
044:                return balanceTyp;
045:            }
046:
047:            public void setBalanceTyp(BalanceTyp balanceTyp) {
048:                this .balanceTyp = balanceTyp;
049:            }
050:
051:            public SufficientFundsItem() {
052:                amount = KualiDecimal.ZERO;
053:            }
054:
055:            /**
056:             * Constructs a SufficientFundsItem.java.
057:             * @param universityFiscalYear
058:             * @param tran
059:             * @param sufficientFundsObjectCode
060:             */
061:            public SufficientFundsItem(Options universityFiscalYear,
062:                    Transaction tran, String sufficientFundsObjectCode) {
063:
064:                amount = KualiDecimal.ZERO;
065:                year = universityFiscalYear;
066:                account = tran.getAccount();
067:                financialObject = tran.getFinancialObject();
068:                financialObjectType = tran.getObjectType();
069:                this .sufficientFundsObjectCode = sufficientFundsObjectCode;
070:                this .balanceTyp = tran.getBalanceType();
071:
072:                add(tran);
073:            }
074:
075:            /**
076:             * Constructs a SufficientFundsItem.java.
077:             * @param universityFiscalYear
078:             * @param accountLine
079:             * @param sufficientFundsObjectCode
080:             */
081:            public SufficientFundsItem(Options universityFiscalYear,
082:                    AccountingLine accountLine, String sufficientFundsObjectCode) {
083:
084:                amount = KualiDecimal.ZERO;
085:                year = universityFiscalYear;
086:                account = accountLine.getAccount();
087:                financialObject = accountLine.getObjectCode();
088:                financialObjectType = accountLine.getObjectType();
089:                this .sufficientFundsObjectCode = sufficientFundsObjectCode;
090:                this .balanceTyp = accountLine.getBalanceTyp();
091:
092:                add(accountLine);
093:            }
094:
095:            /**
096:             * Adds an accounting line's amount to this sufficient funds item
097:             * @param a accounting line
098:             */
099:            public void add(AccountingLine a) {
100:                if (a.getObjectType().getFinObjectTypeDebitcreditCd().equals(
101:                        a.getDebitCreditCode())
102:                        || KFSConstants.EMPTY_STRING.equals(a
103:                                .getDebitCreditCode())) {
104:                    amount = amount.add(a.getAmount());
105:                } else {
106:                    amount = amount.subtract(a.getAmount());
107:                }
108:            }
109:
110:            /**
111:             * Adds a transactions amount to this sufficient funds item
112:             * @param t transactions
113:             */
114:            public void add(Transaction t) {
115:                if (t.getObjectType().getFinObjectTypeDebitcreditCd().equals(
116:                        t.getTransactionDebitCreditCode())
117:                        || KFSConstants.EMPTY_STRING.equals(t
118:                                .getTransactionDebitCreditCode())) {
119:                    amount = amount.add(t.getTransactionLedgerEntryAmount());
120:                } else {
121:                    amount = amount.subtract(t
122:                            .getTransactionLedgerEntryAmount());
123:                }
124:            }
125:
126:            /**
127:             * Compare to other sufficient funds item based on key
128:             * 
129:             * @see java.lang.Comparable#compareTo(java.lang.Object)
130:             */
131:            public int compareTo(Object arg0) {
132:                SufficientFundsItem item = (SufficientFundsItem) arg0;
133:                return getKey().compareTo(item.getKey());
134:            }
135:
136:            /**
137:             * Returns string to uniquely represent this sufficient funds item
138:             * 
139:             * @return string with the following concatenated: fiscal year, chart of accounts code, account number, financial object type code, sufficient funds object code and balance type code
140:             */
141:            public String getKey() {
142:                return year.getUniversityFiscalYear()
143:                        + account.getChartOfAccountsCode()
144:                        + account.getAccountNumber()
145:                        + financialObjectType.getCode()
146:                        + sufficientFundsObjectCode + balanceTyp.getCode();
147:            }
148:
149:            public String getDocumentTypeCode() {
150:                return documentTypeCode;
151:            }
152:
153:            public void setDocumentTypeCode(String documentTypeCode) {
154:                this .documentTypeCode = documentTypeCode;
155:            }
156:
157:            public String getAccountSufficientFundsCode() {
158:                return account.getAccountSufficientFundsCode();
159:            }
160:
161:            public ObjectType getFinancialObjectType() {
162:                return financialObjectType;
163:            }
164:
165:            public void setFinancialObjectType(ObjectType financialObjectType) {
166:                this .financialObjectType = financialObjectType;
167:            }
168:
169:            @Override
170:            public String toString() {
171:                return year.getUniversityFiscalYear() + "-"
172:                        + account.getChartOfAccountsCode() + "-"
173:                        + account.getAccountNumber() + "-"
174:                        + financialObject.getFinancialObjectCode() + "-"
175:                        + account.getAccountSufficientFundsCode() + "-"
176:                        + sufficientFundsObjectCode + "-" + amount.toString();
177:            }
178:
179:            public Account getAccount() {
180:                return account;
181:            }
182:
183:            public void setAccount(Account account) {
184:                this .account = account;
185:            }
186:
187:            public KualiDecimal getAmount() {
188:                return amount;
189:            }
190:
191:            public void setAmount(KualiDecimal amount) {
192:                this .amount = amount;
193:            }
194:
195:            public ObjectCode getFinancialObject() {
196:                return financialObject;
197:            }
198:
199:            public void setFinancialObject(ObjectCode financialObject) {
200:                this .financialObject = financialObject;
201:            }
202:
203:            public String getSufficientFundsObjectCode() {
204:                return sufficientFundsObjectCode;
205:            }
206:
207:            public void setSufficientFundsObjectCode(
208:                    String sufficientFundsObjectCode) {
209:                this .sufficientFundsObjectCode = sufficientFundsObjectCode;
210:            }
211:
212:            public Options getYear() {
213:                return year;
214:            }
215:
216:            public void setYear(Options year) {
217:                this.year = year;
218:            }
219:
220:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.