Source Code Cross Referenced for VerifyTransactionImpl.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » batch » poster » impl » 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.batch.poster.impl 
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.batch.poster.impl;
017:
018:        import java.util.ArrayList;
019:        import java.util.List;
020:
021:        import org.kuali.core.service.KualiConfigurationService;
022:        import org.kuali.kfs.KFSConstants;
023:        import org.kuali.kfs.KFSKeyConstants;
024:        import org.kuali.module.gl.batch.poster.VerifyTransaction;
025:        import org.kuali.module.gl.bo.Transaction;
026:
027:        /**
028:         * A general use implementation of VerifyTransaction
029:         */
030:        public class VerifyTransactionImpl implements  VerifyTransaction {
031:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
032:                    .getLogger(VerifyTransactionImpl.class);
033:            private KualiConfigurationService kualiConfigurationService;
034:
035:            /**
036:             * Constructs a VerifyTransactionImpl instance
037:             */
038:            public VerifyTransactionImpl() {
039:                super ();
040:            }
041:
042:            /**
043:             * Determines if the given transaction qualifies for posting
044:             * 
045:             * @param t the transaction to verify
046:             * @return a List of String error messages
047:             * @see org.kuali.module.gl.batch.poster.VerifyTransaction#verifyTransaction(org.kuali.module.gl.bo.Transaction)
048:             */
049:            public List verifyTransaction(Transaction t) {
050:                LOG.debug("verifyTransaction() started");
051:
052:                // List of error messages for the current transaction
053:                List errors = new ArrayList();
054:
055:                // Check the chart of accounts code
056:                if (t.getChart() == null) {
057:                    errors
058:                            .add(kualiConfigurationService
059:                                    .getPropertyString(KFSKeyConstants.ERROR_CHART_NOT_FOUND));
060:                }
061:
062:                // Check the account
063:                if (t.getAccount() == null) {
064:                    errors
065:                            .add(kualiConfigurationService
066:                                    .getPropertyString(KFSKeyConstants.ERROR_ACCOUNT_NOT_FOUND));
067:                }
068:
069:                // Check the object type
070:                if (t.getObjectType() == null) {
071:                    errors
072:                            .add(kualiConfigurationService
073:                                    .getPropertyString(KFSKeyConstants.ERROR_OBJECT_TYPE_NOT_FOUND));
074:                }
075:
076:                // Check the balance type
077:                if (t.getBalanceType() == null) {
078:                    errors
079:                            .add(kualiConfigurationService
080:                                    .getPropertyString(KFSKeyConstants.ERROR_BALANCE_TYPE_NOT_FOUND));
081:                }
082:
083:                // Check the fiscal year
084:                if (t.getOption() == null) {
085:                    errors
086:                            .add(kualiConfigurationService
087:                                    .getPropertyString(KFSKeyConstants.ERROR_UNIV_FISCAL_YR_NOT_FOUND));
088:                }
089:
090:                // Check the debit/credit code (only if we have a valid balance type code)
091:                if (t.getTransactionDebitCreditCode() == null) {
092:                    errors
093:                            .add(kualiConfigurationService
094:                                    .getPropertyString(KFSKeyConstants.ERROR_DEDIT_CREDIT_CODE_NOT_BE_NULL));
095:                } else {
096:                    if (t.getBalanceType() != null) {
097:                        if (t.getBalanceType()
098:                                .isFinancialOffsetGenerationIndicator()) {
099:                            if ((!KFSConstants.GL_DEBIT_CODE.equals(t
100:                                    .getTransactionDebitCreditCode()))
101:                                    && (!KFSConstants.GL_CREDIT_CODE.equals(t
102:                                            .getTransactionDebitCreditCode()))) {
103:                                errors
104:                                        .add(kualiConfigurationService
105:                                                .getPropertyString(KFSKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE)
106:                                                + KFSConstants.GL_DEBIT_CODE
107:                                                + " or "
108:                                                + KFSConstants.GL_CREDIT_CODE
109:                                                + kualiConfigurationService
110:                                                        .getPropertyString(KFSKeyConstants.MSG_FOR_BALANCE_TYPE));
111:                            }
112:                        } else {
113:                            if (!KFSConstants.GL_BUDGET_CODE.equals(t
114:                                    .getTransactionDebitCreditCode())) {
115:                                errors
116:                                        .add(kualiConfigurationService
117:                                                .getPropertyString(KFSKeyConstants.MSG_DEDIT_CREDIT_CODE_MUST_BE)
118:                                                + KFSConstants.GL_BUDGET_CODE
119:                                                + kualiConfigurationService
120:                                                        .getPropertyString(KFSKeyConstants.MSG_FOR_BALANCE_TYPE));
121:                            }
122:                        }
123:                    }
124:                }
125:
126:                // KULGL-58 Make sure all GL entry primary key fields are not null
127:                if ((t.getSubAccountNumber() == null)
128:                        || (t.getSubAccountNumber().trim().length() == 0)) {
129:                    errors
130:                            .add(kualiConfigurationService
131:                                    .getPropertyString(KFSKeyConstants.ERROR_SUB_ACCOUNT_NOT_BE_NULL));
132:                }
133:                if ((t.getFinancialObjectCode() == null)
134:                        || (t.getFinancialObjectCode().trim().length() == 0)) {
135:                    errors
136:                            .add(kualiConfigurationService
137:                                    .getPropertyString(KFSKeyConstants.ERROR_OBJECT_CODE_NOT_BE_NULL));
138:                }
139:                if ((t.getFinancialSubObjectCode() == null)
140:                        || (t.getFinancialSubObjectCode().trim().length() == 0)) {
141:                    errors
142:                            .add(kualiConfigurationService
143:                                    .getPropertyString(KFSKeyConstants.ERROR_SUB_OBJECT_CODE_NOT_BE_NULL));
144:                }
145:                if ((t.getUniversityFiscalPeriodCode() == null)
146:                        || (t.getUniversityFiscalPeriodCode().trim().length() == 0)) {
147:                    errors
148:                            .add(kualiConfigurationService
149:                                    .getPropertyString(KFSKeyConstants.ERROR_FISCAL_PERIOD_CODE_NOT_BE_NULL));
150:                }
151:                if ((t.getFinancialDocumentTypeCode() == null)
152:                        || (t.getFinancialDocumentTypeCode().trim().length() == 0)) {
153:                    errors
154:                            .add(kualiConfigurationService
155:                                    .getPropertyString(KFSKeyConstants.ERROR_DOCUMENT_TYPE_NOT_BE_NULL));
156:                }
157:                if ((t.getFinancialSystemOriginationCode() == null)
158:                        || (t.getFinancialSystemOriginationCode().trim()
159:                                .length() == 0)) {
160:                    errors
161:                            .add(kualiConfigurationService
162:                                    .getPropertyString(KFSKeyConstants.ERROR_ORIGIN_CODE_NOT_BE_NULL));
163:                }
164:                if ((t.getDocumentNumber() == null)
165:                        || (t.getDocumentNumber().trim().length() == 0)) {
166:                    errors
167:                            .add(kualiConfigurationService
168:                                    .getPropertyString(KFSKeyConstants.ERROR_DOCUMENT_NUMBER_NOT_BE_NULL));
169:                }
170:                if (t.getTransactionLedgerEntrySequenceNumber() == null) {
171:                    errors
172:                            .add(kualiConfigurationService
173:                                    .getPropertyString(KFSKeyConstants.ERROR_SEQUENCE_NUMBER_NOT_BE_NULL));
174:                }
175:
176:                return errors;
177:            }
178:
179:            /**
180:             * Sets the kualiConfigurationService attribute value.
181:             * 
182:             * @param kualiConfigurationService The kualiConfigurationService to set.
183:             */
184:            public void setKualiConfigurationService(
185:                    KualiConfigurationService kualiConfigurationService) {
186:                this.kualiConfigurationService = kualiConfigurationService;
187:            }
188:        }
w_w_w__.__j_a_va__2_s_.c__o__m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.