[OFBiz] SVN: r7328 - in trunk/applications/manufacturing: config webapp/manufacturing/WEB-INF/actions/jobshopmgt webapp/manufacturing/jobshopmgt widget/manufacturing

jacopo@svn.ofbiz.org jacopo at svn.ofbiz.org
Tue Apr 18 09:34:27 CDT 2006


Author: jacopo
Date: 2006-04-18 09:34:06 -0500 (Tue, 18 Apr 2006)
New Revision: 7328

Added:
   trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunCosts.bsh
   trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl
Modified:
   trunk/applications/manufacturing/config/ManufacturingUiLabels.properties
   trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml
   trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl
   trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml
Log:
Added production run sub screen with information about actual costs of each production run task.


Modified: trunk/applications/manufacturing/config/ManufacturingUiLabels.properties
===================================================================
--- trunk/applications/manufacturing/config/ManufacturingUiLabels.properties	2006-04-18 13:30:24 UTC (rev 7327)
+++ trunk/applications/manufacturing/config/ManufacturingUiLabels.properties	2006-04-18 14:34:06 UTC (rev 7328)
@@ -1,7 +1,7 @@
 ####
 # OFBiz UiLabel Properties used for the manufacturing component 
 #
-
+ManufacturingActualCosts=Actual Costs
 ManufacturingAddExistingRoutingTask=Add a existing RoutingTask
 ManufacturingAddProductionRunProductComponent=Add ProductComponent to ProductionRun
 ManufacturingAddRoutingTask=Add a RoutingTask

Added: trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunCosts.bsh
===================================================================
--- trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunCosts.bsh	2006-04-18 13:30:24 UTC (rev 7327)
+++ trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunCosts.bsh	2006-04-18 14:34:06 UTC (rev 7328)
@@ -0,0 +1,45 @@
+/*
+ *
+ * Copyright 2001-2006 The Apache Software Foundation
+ * 
+ * Licensed 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.List;
+import java.util.Iterator;
+import java.util.ArrayList;
+//import java.util.HashMap;
+
+import org.ofbiz.base.util.UtilValidate;
+import org.ofbiz.entity.GenericValue;
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.base.util.UtilMisc;
+import org.ofbiz.widget.html.HtmlFormWrapper;
+
+
+productionRunId = request.getParameter("productionRunId");
+if (UtilValidate.isEmpty(productionRunId)) {
+    productionRunId = request.getParameter("workEffortId");
+}
+
+List taskCosts = new ArrayList();
+List tasks = delegator.findByAnd("WorkEffort", UtilMisc.toMap("workEffortParentId", productionRunId), UtilMisc.toList("workEffortId"));
+Iterator tasksIt = tasks.iterator();
+while (tasksIt.hasNext()) {
+    GenericValue task = (GenericValue)tasksIt.next();
+    List costs = EntityUtil.filterByDate(delegator.findByAnd("CostComponent", UtilMisc.toMap("workEffortId", task.getString("workEffortId"))));
+    HtmlFormWrapper taskCostsForm = new HtmlFormWrapper("/jobshopmgt/ProductionRunForms.xml", "ProductionRunTaskCosts", request, response);
+    taskCostsForm.putInContext("taskCosts", costs);
+    taskCosts.add(UtilMisc.toMap("task", task, "costsForm", taskCostsForm));
+}
+context.put("taskCosts", taskCosts);


Property changes on: trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunCosts.bsh
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + "Date Rev Author URL Id"
Name: svn:eol-style
   + native

Added: trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl
===================================================================
--- trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl	2006-04-18 13:30:24 UTC (rev 7327)
+++ trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl	2006-04-18 14:34:06 UTC (rev 7328)
@@ -0,0 +1,27 @@
+<#--
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+
+<br/>
+<#list taskCosts as taskCost>
+    <#assign task = taskCost.task>
+    <#assign costsForm = taskCost.costsForm>
+    <div>
+        <span class="head2">${task.workEffortName?if_exists} [${task.workEffortId}]</span>
+    </div>
+    ${costsForm.renderFormString(context)}
+    <br/>
+</#list>
\ No newline at end of file


Property changes on: trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + "Date Rev Author URL Id"
Name: svn:eol-style
   + native

Modified: trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml
===================================================================
--- trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml	2006-04-18 13:30:24 UTC (rev 7327)
+++ trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml	2006-04-18 14:34:06 UTC (rev 7328)
@@ -510,4 +510,20 @@
             <display-entity entity-name="WorkEffort" key-field-name="workEffortId" description="${actualCompletionDate} " cache="true"/>
         </field>
     </form>
+    <form name="ProductionRunTaskCosts" type="list" 
+            target="" title="" list-name="taskCosts"
+            default-title-style="tableheadtext" default-widget-style="tabletext" default-tooltip-style="tabletext">
+        <auto-fields-entity entity-name="CostComponent" default-field-type="display"/>
+        <field name="workEffortId"><hidden/></field>
+        <field name="productId"><hidden/></field>
+        <field name="partyId"><hidden/></field>
+        <field name="geoId"><hidden/></field>
+        <field name="productFeatureId"><hidden/></field>
+        <field name="costComponentTypeId">
+            <display-entity entity-name="CostComponentType"/>
+        </field>
+        <field name="costComponentCalcId">
+            <display-entity entity-name="CostComponentCalc"/>
+        </field>
+    </form>
 </forms>
\ No newline at end of file

Modified: trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl
===================================================================
--- trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl	2006-04-18 13:30:24 UTC (rev 7327)
+++ trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl	2006-04-18 14:34:06 UTC (rev 7328)
@@ -33,6 +33,7 @@
         <a href="<@ofbizUrl>EditProductionRun?productionRunId=${productionRunId}</@ofbizUrl>" class="${selectedClassMap.edit?default(unselectedClassName)}">${uiLabelMap.ManufacturingEditProductionRun}</a>
         <#else>
         <a href="<@ofbizUrl>ProductionRunDeclaration?productionRunId=${productionRunId}</@ofbizUrl>" class="${selectedClassMap.declaration?default(unselectedClassName)}">${uiLabelMap.ManufacturingProductionRunDeclaration}</a>
+        <a href="<@ofbizUrl>ProductionRunCosts?productionRunId=${productionRunId}</@ofbizUrl>" class="${selectedClassMap.costs?default(unselectedClassName)}">${uiLabelMap.ManufacturingActualCosts}</a>
         </#if>
         <a href="<@ofbizUrl>ProductionRunAssocs?productionRunId=${productionRunId}</@ofbizUrl>" class="${selectedClassMap.assocs?default(unselectedClassName)}">${uiLabelMap.ManufacturingProductionRunAssocs}</a>
     </#if>

Modified: trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml
===================================================================
--- trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml	2006-04-18 13:30:24 UTC (rev 7327)
+++ trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml	2006-04-18 14:34:06 UTC (rev 7328)
@@ -159,6 +159,34 @@
             </widgets>
         </section>
     </screen>
+    <screen name="ProductionRunCosts">
+        <section>
+            <actions>
+                <set field="title" value="Production Run Actual Costs"/>
+                <set field="titleProperty" value="ManufacturingProductionRunCosts"/>
+                <set field="tabButtonItem" value="costs"/>
+                <set field="headerItem" value="jobshop"/>
+
+                <set field="productionRunId" from-field="parameters.productionRunId"/>
+                <entity-one entity-name="WorkEffort" value-name="productionRun">
+                    <field-map field-name="workEffortId" env-name="productionRunId"/>
+                </entity-one>
+                <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunCosts.bsh"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonJobshopDecorator">
+                    <decorator-section name="body">
+                        <container>
+                            <label style="head2">${uiLabelMap.ManufacturingActualCosts}</label>
+                        </container>
+                        <platform-specific>
+                            <html><html-template location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunCosts.ftl"/></html>
+                        </platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
     <screen name="FindProductionRun">
         <section>
             <actions>



More information about the Svn mailing list