Source Code Cross Referenced for BalanceForwardStep.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » gl » batch » 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 
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;
017:
018:        import java.sql.Date;
019:        import java.text.DateFormat;
020:        import java.text.ParseException;
021:        import java.text.SimpleDateFormat;
022:
023:        import org.kuali.kfs.batch.AbstractStep;
024:        import org.kuali.kfs.service.impl.ParameterConstants;
025:        import org.kuali.module.gl.GLConstants;
026:        import org.kuali.module.gl.batch.closing.year.service.YearEndService;
027:        import org.kuali.module.gl.batch.closing.year.service.impl.helper.BalanceForwardRuleHelper;
028:        import org.kuali.module.gl.bo.OriginEntryGroup;
029:        import org.kuali.module.gl.bo.OriginEntrySource;
030:        import org.kuali.module.gl.service.OriginEntryGroupService;
031:        import org.springframework.util.StopWatch;
032:
033:        /**
034:         * This step runs the balance forward year end process.
035:         */
036:        public class BalanceForwardStep extends AbstractStep {
037:            private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
038:                    .getLogger(BalanceForwardStep.class);
039:
040:            private YearEndService yearEndService;
041:            private OriginEntryGroupService originEntryGroupService;
042:
043:            public static final String TRANSACTION_DATE_FORMAT_STRING = "yyyy-MM-dd";
044:
045:            /**
046:             * This step runs the balance forward service, specifically finding the parameters the job needs, creating the origin entry
047:             * groups for the output origin entries, and creating the process's reports.
048:             * 
049:             * @param jobName the name of the job that this step is a part of
050:             * @return that the job finished successfully
051:             * @see org.kuali.kfs.batch.Step#execute(java.lang.String)
052:             */
053:            public boolean execute(String jobName) {
054:                StopWatch stopWatch = new StopWatch();
055:                stopWatch.start(jobName);
056:
057:                Date varTransactionDate;
058:                try {
059:                    DateFormat transactionDateFormat = new SimpleDateFormat(
060:                            TRANSACTION_DATE_FORMAT_STRING);
061:                    varTransactionDate = new Date(
062:                            transactionDateFormat
063:                                    .parse(
064:                                            getParameterService()
065:                                                    .getParameterValue(
066:                                                            ParameterConstants.GENERAL_LEDGER_BATCH.class,
067:                                                            GLConstants.ANNUAL_CLOSING_TRANSACTION_DATE_PARM))
068:                                    .getTime());
069:                } catch (ParseException e) {
070:                    LOG
071:                            .error(
072:                                    "forwardBalances() Unable to parse transaction date",
073:                                    e);
074:                    throw new IllegalArgumentException(
075:                            "Unable to parse transaction date");
076:                }
077:
078:                Integer varFiscalYear = new Integer(getParameterService()
079:                        .getParameterValue(
080:                                ParameterConstants.GENERAL_LEDGER_BATCH.class,
081:                                GLConstants.ANNUAL_CLOSING_FISCAL_YEAR_PARM));
082:
083:                yearEndService.logAllMissingPriorYearAccounts(varFiscalYear);
084:                yearEndService.logAllMissingSubFundGroups(varFiscalYear);
085:
086:                OriginEntryGroup balanceForwardsUnclosedPriorYearAccountGroup = originEntryGroupService
087:                        .createGroup(varTransactionDate,
088:                                OriginEntrySource.YEAR_END_BEGINNING_BALANCE,
089:                                true, false, true);
090:                OriginEntryGroup balanceForwardsClosedPriorYearAccountGroup = originEntryGroupService
091:                        .createGroup(
092:                                varTransactionDate,
093:                                OriginEntrySource.YEAR_END_BEGINNING_BALANCE_PRIOR_YEAR,
094:                                true, false, true);
095:
096:                BalanceForwardRuleHelper balanceForwardRuleHelper = new BalanceForwardRuleHelper(
097:                        varFiscalYear, varTransactionDate,
098:                        balanceForwardsClosedPriorYearAccountGroup,
099:                        balanceForwardsUnclosedPriorYearAccountGroup);
100:
101:                yearEndService.forwardBalances(
102:                        balanceForwardsUnclosedPriorYearAccountGroup,
103:                        balanceForwardsClosedPriorYearAccountGroup,
104:                        balanceForwardRuleHelper);
105:
106:                yearEndService.generateForwardBalanceReports(
107:                        balanceForwardsUnclosedPriorYearAccountGroup,
108:                        balanceForwardsClosedPriorYearAccountGroup,
109:                        balanceForwardRuleHelper);
110:
111:                stopWatch.stop();
112:                LOG.info(jobName + " took "
113:                        + (stopWatch.getTotalTimeSeconds() / 60.0)
114:                        + " minutes to complete");
115:
116:                return true;
117:            }
118:
119:            /**
120:             * Sets the yearEndService attribute, allowing injection of an implementation of the service
121:             * 
122:             * @param yearEndService an implementation of the yearEndService
123:             * @see org.kuali.module.gl.service.yearEndService
124:             */
125:            public void setYearEndService(YearEndService yearEndService) {
126:                this .yearEndService = yearEndService;
127:            }
128:
129:            /**
130:             * Sets the originEntryGroupService attribute value.
131:             * 
132:             * @param originEntryGroupService The originEntryGroupService to set.
133:             * @see org.kuali.module.gl.service.OriginEntryGroupService
134:             */
135:            public void setOriginEntryGroupService(
136:                    OriginEntryGroupService originEntryGroupService) {
137:                this.originEntryGroupService = originEntryGroupService;
138:            }
139:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.