Source Code Cross Referenced for BudgetFringeRateServiceImpl.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » kra » budget » service » 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.kra.budget.service.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.kra.budget.service.impl;
017:
018:        import java.util.Collection;
019:        import java.util.HashMap;
020:        import java.util.Iterator;
021:        import java.util.Map;
022:
023:        import org.apache.commons.lang.StringUtils;
024:        import org.kuali.core.service.BusinessObjectService;
025:        import org.kuali.core.service.DocumentService;
026:        import org.kuali.core.util.KualiDecimal;
027:        import org.kuali.kfs.KFSConstants;
028:        import org.kuali.kfs.KFSPropertyConstants;
029:        import org.kuali.kfs.service.ParameterService;
030:        import org.kuali.kfs.service.impl.ParameterConstants;
031:        import org.kuali.module.kra.KraConstants;
032:        import org.kuali.module.kra.budget.bo.AppointmentType;
033:        import org.kuali.module.kra.budget.bo.Budget;
034:        import org.kuali.module.kra.budget.bo.BudgetFringeRate;
035:        import org.kuali.module.kra.budget.bo.BudgetUser;
036:        import org.kuali.module.kra.budget.service.BudgetFringeRateService;
037:        import org.springframework.transaction.annotation.Transactional;
038:
039:        /**
040:         * This class is the service implementation for the Account structure. This is the default, Kuali provided implementation.
041:         */
042:        @Transactional
043:        public class BudgetFringeRateServiceImpl implements 
044:                BudgetFringeRateService {
045:
046:            private ParameterService parameterService;
047:            private BusinessObjectService businessObjectService;
048:            private DocumentService documentService;
049:
050:            public BudgetFringeRate getBudgetFringeRate(String documentNumber,
051:                    String institutionAppointmentTypeCode) {
052:
053:                BudgetFringeRate budgetFringeRate = (BudgetFringeRate) businessObjectService
054:                        .retrieve(new BudgetFringeRate(documentNumber,
055:                                institutionAppointmentTypeCode));
056:
057:                if (budgetFringeRate == null) {
058:                    AppointmentType appointmentType = (AppointmentType) businessObjectService
059:                            .retrieve(new AppointmentType(
060:                                    institutionAppointmentTypeCode));
061:                    budgetFringeRate = new BudgetFringeRate(documentNumber,
062:                            appointmentType);
063:                }
064:
065:                return budgetFringeRate;
066:            }
067:
068:            /**
069:             * @see org.kuali.module.kra.budget.service.BudgetFringeRateService#getDefaultFringeRates()
070:             */
071:            public Collection getDefaultFringeRates() {
072:                Map fieldValues = new HashMap();
073:                fieldValues.put(KFSPropertyConstants.ACTIVE,
074:                        KFSConstants.ACTIVE_INDICATOR);
075:
076:                return businessObjectService.findMatching(
077:                        AppointmentType.class, fieldValues);
078:            }
079:
080:            public BudgetFringeRate getBudgetFringeRateForDefaultAppointmentType(
081:                    String documentNumber) {
082:
083:                AppointmentType appointmentType = (AppointmentType) businessObjectService
084:                        .retrieve(new AppointmentType(
085:                                parameterService
086:                                        .getParameterValue(
087:                                                ParameterConstants.RESEARCH_ADMINISTRATION_DOCUMENT.class,
088:                                                KraConstants.DEFAULT_APPOINTMENT_TYPE)));
089:
090:                BudgetFringeRate defaultFringeRate = (BudgetFringeRate) businessObjectService
091:                        .retrieve(new BudgetFringeRate(documentNumber,
092:                                appointmentType.getAppointmentTypeCode()));
093:
094:                if (defaultFringeRate != null) {
095:                    return defaultFringeRate;
096:                } else {
097:                    return new BudgetFringeRate(documentNumber, appointmentType);
098:                }
099:            }
100:
101:            public BudgetFringeRate getBudgetFringeRateForPerson(
102:                    BudgetUser budgetUser) {
103:                if (StringUtils.isNotEmpty(budgetUser.getAppointmentTypeCode())) {
104:                    return this .getBudgetFringeRate(budgetUser
105:                            .getDocumentNumber(), budgetUser
106:                            .getAppointmentTypeCode());
107:                } else if (budgetUser.getUserAppointmentTasks().size() > 0
108:                        && StringUtils.isNotEmpty(budgetUser
109:                                .getUserAppointmentTask(0)
110:                                .getInstitutionAppointmentTypeCode())) {
111:                    return this .getBudgetFringeRate(budgetUser
112:                            .getDocumentNumber(), budgetUser
113:                            .getUserAppointmentTask(0)
114:                            .getInstitutionAppointmentTypeCode());
115:                } else {
116:                    return this 
117:                            .getBudgetFringeRateForDefaultAppointmentType(budgetUser
118:                                    .getDocumentNumber());
119:                }
120:            }
121:
122:            public boolean isValidFringeRate(KualiDecimal fringeRate) {
123:                if (fringeRate != null) {
124:                    return fringeRate
125:                            .isLessEqual(KFSConstants.CONTRACTS_AND_GRANTS_FRINGE_RATE_MAX);
126:                } else {
127:                    return false;
128:                }
129:            }
130:
131:            public boolean isValidCostShare(KualiDecimal costShare) {
132:                if (costShare != null) {
133:                    return costShare
134:                            .isLessEqual(KFSConstants.CONTRACTS_AND_GRANTS_COST_SHARE_MAX);
135:                } else {
136:                    return false;
137:                }
138:            }
139:
140:            public void setupDefaultFringeRates(Budget budget) {
141:                for (Iterator iter = getDefaultFringeRates().iterator(); iter
142:                        .hasNext();) {
143:                    AppointmentType appType = (AppointmentType) iter.next();
144:                    BudgetFringeRate bfr = new BudgetFringeRate(budget
145:                            .getDocumentNumber(), appType
146:                            .getAppointmentTypeCode(), appType
147:                            .getFringeRateAmount(), appType
148:                            .getCostShareFringeRateAmount(), appType);
149:                    budget.getFringeRates().add(bfr);
150:                }
151:            }
152:
153:            public void setParameterService(ParameterService parameterService) {
154:                this .parameterService = parameterService;
155:            }
156:
157:            public void setBusinessObjectService(
158:                    BusinessObjectService businessObjectService) {
159:                this .businessObjectService = businessObjectService;
160:            }
161:
162:            public void setDocumentService(DocumentService documentService) {
163:                this.documentService = documentService;
164:            }
165:        }
w_w___w.___ja__v___a2_s._com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.