You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2007/12/26 09:13:38 UTC

svn commit: r606853 - in /ofbiz/trunk/specialpurpose/projectmgr: config/ webapp/projectmgr/WEB-INF/ webapp/projectmgr/WEB-INF/actions/ widget/ widget/forms/

Author: hansbak
Date: Wed Dec 26 00:13:36 2007
New Revision: 606853

URL: http://svn.apache.org/viewvc?rev=606853&view=rev
Log:
first version of project billing

Added:
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh
Modified:
    ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties?rev=606853&r1=606852&r2=606853&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties Wed Dec 26 00:13:36 2007
@@ -49,11 +49,13 @@
 PageTitleFindSubProject=Find Sub Project
 PageTitleFindSubTask=Find Sub Task
 PageTitleFindTask=Find Task
+PageTitleHoursNotYetBilled=Hours not yet billed
 PageTitleListPartyAssigns=Current Resource Assignments
 PageTitleListProjectNotes=List Project Notes
 PageTitleListResources=Resources
 PageTitleListTaskNotes=List Task Notes
 PageTitleMyTimesheets=My timesheet list
+PageTitleProjectBilling=Project Billing
 PageTitleProjectInformation=Project Information
 PageTitleRequestList=Request List
 PageTitleTasksAfter=Tasks to be executed after the current task
@@ -66,6 +68,7 @@
 ProjectMgrAssignATaskToMe=Assign an existing Task to me.
 ProjectMgrAssignMyTaskToSomebodyElse=Assign My Task To Somebody Else.
 ProjectMgrSchedule=Schedule
+ProjectMgrBilling=Billing
 ProjectMgrCompanyName=Ofbiz Company
 ProjectMgrCompanySubtitle=Project
 ProjectMgrCopyProject=Copy Project

Added: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh?rev=606853&view=auto
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh (added)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh Wed Dec 26 00:13:36 2007
@@ -0,0 +1,69 @@
+/*
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+  
+import java.util.*;
+import java.lang.*;
+import java.util.Iterator;
+import javolution.util.FastMap;
+import java.math.BigDecimal;
+
+import org.ofbiz.entity.*;
+import org.ofbiz.base.util.*;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.condition.EntityConditionList;
+import org.ofbiz.entity.condition.EntityExpr;
+import org.ofbiz.entity.condition.EntityOperator;
+
+
+import org.ofbiz.entity.util.*;
+import org.ofbiz.base.util.*;
+import org.ofbiz.entity.condition.*;
+import java.sql.Timestamp;
+
+projectId = parameters.get("projectId");
+
+// get all tasks from the project, get related time entries and checked if not invoiced
+List entryList = new LinkedList();
+entries = delegator.findByAnd("ProjectAndPhaseAndTask", UtilMisc.toMap("projectId", projectId), UtilMisc.toList("phaseName", "workEffortName"));
+t = entries.iterator();
+while (t.hasNext()) {
+	entry = t.next();
+	entryItems = entry.getRelated("TimeEntry");
+	e = entryItems.iterator();
+	while (e.hasNext()) {
+		entryItem = e.next();
+		if (entryItem.getString("invoiceId") == null) {
+			timesheet = entryItem.getRelatedOne("Timesheet");
+			if (timesheet.getString("statusId").equals("TIMESHEET_COMPLETED")) {
+				Map all = FastMap.newInstance();
+				all.put("workEffortName", entry.getString("workEffortName"));
+				all.put("workEffortId", entry.getString("workEffortId"));
+				all.put("phaseName", entry.getString("phaseName"));
+				all.put("phaseId", entry.getString("phaseId"));
+				all.put("partyId", timesheet.getString("partyId"));
+				all.put("hours", entryItem.getDouble("hours"));
+				all.put("fromDate", entryItem.getTimestamp("fromDate"));
+				entryList.add(all);
+			}
+		}
+	} 
+}
+context.put("entryList", entryList); 

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml?rev=606853&r1=606852&r2=606853&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml Wed Dec 26 00:13:36 2007
@@ -55,6 +55,10 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="EditProject"/>
     </request-map>
+    <request-map uri="projectBilling">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="projectBilling"/>
+    </request-map>
     <request-map uri="createProject">
         <security https="true" auth="true"/>
         <event type="service" invoke="createProject"/>
@@ -493,6 +497,7 @@
     <view-map name="FindResource" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#FindResource"/>    
     <view-map name="FindProject" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#FindProject"/>    
     <view-map name="EditProject" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#EditProject"/>
+    <view-map name="projectBilling" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#projectBilling"/>
     <view-map name="EditWorkEffort" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#EditProject"/>
     <view-map name="ChildWorkEfforts" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#ChildWorkEfforts"/>
     <view-map name="EditProjectAndAssoc" type="screen" page="component://projectmgr/widget/ProjectScreens.xml#EditProjectAndAssoc"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml?rev=606853&r1=606852&r2=606853&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/Menus.xml Wed Dec 26 00:13:36 2007
@@ -55,7 +55,8 @@
         <menu-item name="tasks" title="${uiLabelMap.ProjectMgrTasks}"><link target="EditProjectTasks?projectId=${projectId}"/></menu-item>        
         <menu-item name="parties" title="${uiLabelMap.ProjectMgrResources}"><link target="ListWorkEffortPartyAssigns?projectId=${projectId}"/></menu-item>
         <menu-item name="notes" title="${uiLabelMap.CommonNotes}"><link target="EditWorkEffortNotes?projectId=${projectId}"/></menu-item>
-        <menu-item name="subprojects" title="${uiLabelMap.ProjectMgrSubProjects}"><link target="ListSubProjects?projectId=${projectId}"/></menu-item>
+        <menu-item name="subprojects" title="${uiLabelMap.ProjectMgrSubProjects}"><link target="ListSubProjects?projectId=${projectId}"/></menu-item>
+        <menu-item name="billing" title="${uiLabelMap.ProjectMgrBilling}"><link target="projectBilling?projectId=${projectId}"/></menu-item>
         <!--menu-item name="treeDetails" title="${uiLabelMap.ProjectMgrTreeDetails}"><link target="ChildWorkEfforts?projectId=${projectId}&amp;trail=${workEffortId}&amp;workEffortTypeId=PROJECT&amp;workEffortAssocTypeId=WORK_EFF_BREAKDOWN"/></menu-item-->
     </menu>
     <menu name="ProjectSubTabBar" type="simple" menu-container-style="button-bar button-style-2" default-selected-style="selected">

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml?rev=606853&r1=606852&r2=606853&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/ProjectScreens.xml Wed Dec 26 00:13:36 2007
@@ -131,21 +131,43 @@
                 <set field="titleProperty" value="PageTitleEditProject"/>
                 <set field="tabButtonItem" value="editproject"/>                
                 <set field="labelTitleProperty" value="PageTitleEditProject"/>
-                <set field="projectId" from-field="parameters.projectId" default-value="${parameters.workEffortId}"/>
-                <service service-name="getProject" result-map-name="result">
-                    <field-map field-name="projectId" env-name="projectId"/>
-                </service>
+                <set field="projectId" from-field="parameters.projectId" default-value="${parameters.workEffortId}"/>
+                <service service-name="getProject" result-map-name="result">
+                    <field-map field-name="projectId" env-name="projectId"/>
+                </service>
                 <set field="project" from-field="result.projectInfo"/>
             </actions>
-            <widgets>
+            <widgets>
                 <decorator-screen name="CommonProjectDecorator" location="${parameters.mainDecoratorLocation}">
-                    <decorator-section name="body">  
-                        <container style="screenlet">
-                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleEditProject} ${uiLabelMap.CommonInformation}</label></container>                                
-                            <container style="screenlet-body"> 
-                                <include-form name="EditProject" location="component://projectmgr/widget/forms/ProjectForms.xml"/>
-                            </container>
-                        </container>
+                    <decorator-section name="body">  
+                        <container style="screenlet">
+                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleEditProject} ${uiLabelMap.CommonInformation}</label></container>                                
+                            <container style="screenlet-body"> 
+                                <include-form name="EditProject" location="component://projectmgr/widget/forms/ProjectForms.xml"/>
+                            </container>
+                        </container>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="projectBilling">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleProjectBilling"/>
+                <set field="tabButtonItem" value="billing"/>                
+                <set field="labelTitleProperty" value="PageTitleProjectBilling"/>
+                <set field="projectId" from-field="parameters.projectId" default-value="${parameters.workEffortId}"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonProjectDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">  
+                        <container style="screenlet">
+                            <container style="screenlet-title-bar"><label style="boxhead">${uiLabelMap.PageTitleHoursNotYetBilled} ${uiLabelMap.CommonInformation}</label></container>                                
+                            <container style="screenlet-body"> 
+                                <include-form name="hoursNotYetBilled" location="component://projectmgr/widget/forms/ProjectForms.xml"/>
+                            </container>
+                        </container>
                     </decorator-section>
                 </decorator-screen>
             </widgets>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=606853&r1=606852&r2=606853&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml Wed Dec 26 00:13:36 2007
@@ -98,6 +98,16 @@
         <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><date-time type="date"/></field>
         <field name="projectName" parameter-name="workEffortName" title="${uiLabelMap.ProjectMgrProjectName}"><text/></field>
         <field name="find" title="${uiLabelMap.CommonFind}"><submit/></field>
+    </form>
+    <form name="hoursNotYetBilled" type="list" list-name="entryList">
+        <actions>
+            <script location="component://projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh"/>
+        </actions>
+        <field name="workEffortName"><display/></field>
+        <field name="phaseName"><display/></field>
+        <field name="hours"><display/></field>
+        <field name="partyId"><display-entity entity-name="PartyNameView" description="${firstName} ${middleName} ${lastName}"/></field>
+        <field name="fromDate"><display type="date"/></field>
     </form>
     <form name="ListProjects" type="list" list-name="projects" paginate-target="FindProject">
         <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}" widget-style="buttontext">