Source Code Cross Referenced for CreditCardReceiptAction.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » financial » web » struts » action » 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.web.struts.action 
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.financial.web.struts.action;
017:
018:        import javax.servlet.http.HttpServletRequest;
019:        import javax.servlet.http.HttpServletResponse;
020:
021:        import org.apache.struts.action.ActionForm;
022:        import org.apache.struts.action.ActionForward;
023:        import org.apache.struts.action.ActionMapping;
024:        import org.kuali.core.util.GlobalVariables;
025:        import org.kuali.kfs.KFSConstants;
026:        import org.kuali.kfs.KFSPropertyConstants;
027:        import org.kuali.kfs.web.struts.action.KualiAccountingDocumentActionBase;
028:        import org.kuali.module.financial.bo.CreditCardDetail;
029:        import org.kuali.module.financial.document.CreditCardReceiptDocument;
030:        import org.kuali.module.financial.rules.CreditCardReceiptDocumentRuleUtil;
031:        import org.kuali.module.financial.web.struts.form.CreditCardReceiptForm;
032:
033:        /**
034:         * This is the action class for the CreditCardReceiptDocument.
035:         */
036:        public class CreditCardReceiptAction extends
037:                KualiAccountingDocumentActionBase {
038:            /**
039:             * Adds handling for credit card receipt amount updates.
040:             * 
041:             * @see org.apache.struts.action.Action#execute(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm,
042:             *      javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
043:             */
044:            public ActionForward execute(ActionMapping mapping,
045:                    ActionForm form, HttpServletRequest request,
046:                    HttpServletResponse response) throws Exception {
047:                CreditCardReceiptForm ccrForm = (CreditCardReceiptForm) form;
048:
049:                if (ccrForm.hasDocumentId()) {
050:                    CreditCardReceiptDocument ccrDoc = ccrForm
051:                            .getCreditCardReceiptDocument();
052:
053:                    ccrDoc.setTotalCreditCardAmount(ccrDoc
054:                            .calculateCreditCardReceiptTotal()); // recalc b/c changes to the amounts could
055:                    // have happened
056:                }
057:
058:                // proceed as usual
059:                return super .execute(mapping, form, request, response);
060:            }
061:
062:            /**
063:             * Adds a CreditCardDetail instance created from the current "new creditCardReceipt" line to the document
064:             * 
065:             * @param mapping
066:             * @param form
067:             * @param request
068:             * @param response
069:             * @return ActionForward
070:             * @throws Exception
071:             */
072:            public ActionForward addCreditCardReceipt(ActionMapping mapping,
073:                    ActionForm form, HttpServletRequest request,
074:                    HttpServletResponse response) throws Exception {
075:                CreditCardReceiptForm ccrForm = (CreditCardReceiptForm) form;
076:                CreditCardReceiptDocument ccrDoc = ccrForm
077:                        .getCreditCardReceiptDocument();
078:
079:                CreditCardDetail newCreditCardReceipt = ccrForm
080:                        .getNewCreditCardReceipt();
081:                ccrDoc.prepareNewCreditCardReceipt(newCreditCardReceipt);
082:
083:                // creditCardReceipt business rules
084:                boolean rulePassed = validateNewCreditCardReceipt(newCreditCardReceipt);
085:                if (rulePassed) {
086:                    // add creditCardReceipt
087:                    ccrDoc.addCreditCardReceipt(newCreditCardReceipt);
088:
089:                    // clear the used creditCardReceipt
090:                    ccrForm.setNewCreditCardReceipt(new CreditCardDetail());
091:                }
092:
093:                return mapping.findForward(KFSConstants.MAPPING_BASIC);
094:            }
095:
096:            /**
097:             * Deletes the selected creditCardReceipt (line) from the document
098:             * 
099:             * @param mapping
100:             * @param form
101:             * @param request
102:             * @param response
103:             * @return ActionForward
104:             * @throws Exception
105:             */
106:            public ActionForward deleteCreditCardReceipt(ActionMapping mapping,
107:                    ActionForm form, HttpServletRequest request,
108:                    HttpServletResponse response) throws Exception {
109:                CreditCardReceiptForm ccrForm = (CreditCardReceiptForm) form;
110:                CreditCardReceiptDocument ccrDoc = ccrForm
111:                        .getCreditCardReceiptDocument();
112:
113:                int deleteIndex = getLineToDelete(request);
114:                // delete creditCardReceipt
115:                ccrDoc.removeCreditCardReceipt(deleteIndex);
116:
117:                return mapping.findForward(KFSConstants.MAPPING_BASIC);
118:            }
119:
120:            /**
121:             * This method validates a new credit card receipt detail record.
122:             * 
123:             * @param creditCardReceipt
124:             * @return boolean
125:             */
126:            private boolean validateNewCreditCardReceipt(
127:                    CreditCardDetail creditCardReceipt) {
128:                GlobalVariables.getErrorMap().addToErrorPath(
129:                        KFSPropertyConstants.NEW_CREDIT_CARD_RECEIPT);
130:                boolean isValid = CreditCardReceiptDocumentRuleUtil
131:                        .validateCreditCardReceipt(creditCardReceipt);
132:                GlobalVariables.getErrorMap().removeFromErrorPath(
133:                        KFSPropertyConstants.NEW_CREDIT_CARD_RECEIPT);
134:                return isValid;
135:            }
136:        }
w__w___w__.___j__a___va__2s__._c__o___m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.