Source Code Cross Referenced for AccountsPayableFormBase.java in  » ERP-CRM-Financial » Kuali-Financial-System » org » kuali » module » purap » web » struts » form » 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.purap.web.struts.form 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 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.purap.web.struts.form;
017:
018:        import java.util.List;
019:
020:        import javax.servlet.http.HttpServletRequest;
021:
022:        import org.kuali.core.bo.user.UniversalUser;
023:        import org.kuali.core.util.GlobalVariables;
024:        import org.kuali.core.web.ui.ExtraButton;
025:        import org.kuali.kfs.context.SpringContext;
026:        import org.kuali.kfs.service.ParameterService;
027:        import org.kuali.kfs.service.impl.ParameterConstants;
028:        import org.kuali.module.purap.PurapParameterConstants;
029:        import org.kuali.module.purap.bo.PurApItem;
030:        import org.kuali.module.purap.document.AccountsPayableDocument;
031:        import org.kuali.module.purap.service.PurchaseOrderService;
032:        import org.kuali.module.purap.util.PurApItemUtils;
033:
034:        /**
035:         * Struts Action Form for Accounts Payable documents.
036:         */
037:        public class AccountsPayableFormBase extends
038:                PurchasingAccountsPayableFormBase {
039:
040:            private PurApItem newPurchasingItemLine;
041:            private boolean calculated;
042:            private int countOfAboveTheLine = 0;
043:            private int countOfBelowTheLine = 0;
044:
045:            /**
046:             * Constructs an AccountsPayableForm instance and sets up the appropriately casted document.
047:             */
048:            public AccountsPayableFormBase() {
049:                super ();
050:                calculated = false;
051:            }
052:
053:            public PurApItem getNewPurchasingItemLine() {
054:                return newPurchasingItemLine;
055:            }
056:
057:            public void setNewPurchasingItemLine(PurApItem newPurchasingItemLine) {
058:                this .newPurchasingItemLine = newPurchasingItemLine;
059:            }
060:
061:            public PurApItem getAndResetNewPurchasingItemLine() {
062:                PurApItem aPurchasingItemLine = getNewPurchasingItemLine();
063:                setNewPurchasingItemLine(setupNewPurchasingItemLine());
064:                return aPurchasingItemLine;
065:            }
066:
067:            /**
068:             * This method should be overriden (or see accountingLines for an alternate way of doing this with newInstance)
069:             * 
070:             * @return - null, enforces overriding
071:             */
072:            public PurApItem setupNewPurchasingItemLine() {
073:                return null;
074:            }
075:
076:            public boolean isCalculated() {
077:                return calculated;
078:            }
079:
080:            public void setCalculated(boolean calculated) {
081:                this .calculated = calculated;
082:            }
083:
084:            public int getCountOfAboveTheLine() {
085:                return countOfAboveTheLine;
086:            }
087:
088:            public void setCountOfAboveTheLine(int countOfAboveTheLine) {
089:                this .countOfAboveTheLine = countOfAboveTheLine;
090:            }
091:
092:            public int getCountOfBelowTheLine() {
093:                return countOfBelowTheLine;
094:            }
095:
096:            public void setCountOfBelowTheLine(int countOfBelowTheLine) {
097:                this .countOfBelowTheLine = countOfBelowTheLine;
098:            }
099:
100:            /**
101:             * Determines if the current user is an AP user and returns true, false otherwise.
102:             * 
103:             * @return - true if current user is AP user, false otherwise.
104:             */
105:            public boolean isApUser() {
106:
107:                boolean apUser = false;
108:                UniversalUser user = GlobalVariables.getUserSession()
109:                        .getUniversalUser();
110:
111:                String apGroup = SpringContext
112:                        .getBean(ParameterService.class)
113:                        .getParameterValue(
114:                                ParameterConstants.PURCHASING_DOCUMENT.class,
115:                                PurapParameterConstants.Workgroups.WORKGROUP_ACCOUNTS_PAYABLE);
116:
117:                if (user.isMember(apGroup)) {
118:                    apUser = true;
119:                }
120:
121:                return apUser;
122:            }
123:
124:            /**
125:             * Adds a new button to the extra buttons collection.
126:             * 
127:             * @param property - property for button
128:             * @param source - location of image
129:             * @param altText - alternate text for button if images don't appear
130:             */
131:            protected void addExtraButton(String property, String source,
132:                    String altText) {
133:
134:                ExtraButton newButton = new ExtraButton();
135:
136:                newButton.setExtraButtonProperty(property);
137:                newButton.setExtraButtonSource(source);
138:                newButton.setExtraButtonAltText(altText);
139:
140:                extraButtons.add(newButton);
141:            }
142:
143:            /**
144:             * @see org.kuali.kfs.web.struts.form.KualiAccountingDocumentFormBase#populate(javax.servlet.http.HttpServletRequest)
145:             */
146:            @Override
147:            public void populate(HttpServletRequest request) {
148:                super .populate(request);
149:                AccountsPayableDocument apDoc = (AccountsPayableDocument) this 
150:                        .getDocument();
151:
152:                // update po doc
153:                apDoc.setPurchaseOrderDocument(SpringContext.getBean(
154:                        PurchaseOrderService.class).getCurrentPurchaseOrder(
155:                        apDoc.getPurchaseOrderIdentifier()));
156:
157:                // update counts after populate
158:                updateItemCounts();
159:            }
160:
161:            /**
162:             * Updates item counts for display
163:             */
164:            public void updateItemCounts() {
165:                List<PurApItem> items = ((AccountsPayableDocument) this
166:                        .getDocument()).getItems();
167:                countOfBelowTheLine = PurApItemUtils
168:                        .countBelowTheLineItems(items);
169:                countOfAboveTheLine = items.size() - countOfBelowTheLine;
170:            }
171:
172:        }
w___w_w_.___j__a_v___a___2s.___co___m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.