diff --git a/applications/manufacturing/config/ManufacturingUiLabels.properties b/applications/manufacturing/config/ManufacturingUiLabels.properties index 14ea42cdf9..0010d2b1f4 100644 --- a/applications/manufacturing/config/ManufacturingUiLabels.properties +++ b/applications/manufacturing/config/ManufacturingUiLabels.properties @@ -126,6 +126,7 @@ ManufacturingMainPageNote=NOTE\: This application is currently in development. T ManufacturingManagerApplication=Manufacturing Manager Application ManufacturingMandatoryWorkEfforts=Mandatory Production Runs ManufacturingManufacturingRules=Manufacturing Rules +ManufacturingMaterials=Materials ManufacturingMrp=MRP ManufacturingMrpInitialisation=IEP init. ManufacturingNewCalendar=New calendar diff --git a/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh index 4c213b23a3..38da4612b5 100644 --- a/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh +++ b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/EditProductionRun.bsh @@ -143,59 +143,12 @@ if (!UtilValidate.isEmpty(productionRunId)) { } // RoutingTasks list List productionRunRoutingTasks = productionRun.getProductionRunRoutingTasks(); - HtmlFormWrapper ListProductionRunRoutingTasksWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "ListProductionRunRoutingTasks", request, response); - ListProductionRunRoutingTasksWrapper.putInContext("productionRunRoutingTasks", productionRunRoutingTasks); - context.put("ListProductionRunRoutingTasksWrapper",ListProductionRunRoutingTasksWrapper); + context.put("productionRunRoutingTasks", productionRunRoutingTasks); - //--------------- - // Components - //--------------- - // Product component add sub-screen - if (actionForm.equals("AddProductComponent")){ - Map productComponentData = UtilMisc.toMap("productionRunId", productionRunId); - HtmlFormWrapper editPrProductComponentWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "EditProductionRunComponent", request, response); - editPrProductComponentWrapper.putInContext("productComponentData", productComponentData); - editPrProductComponentWrapper.putInContext("actionForm", "addProductComponent"); - editPrProductComponentWrapper.putInContext("actionIsAdd","Y"); - context.put("editPrProductComponentWrapper",editPrProductComponentWrapper); - } - // Product component update sub-screen - productId = request.getParameter("productId"); - if (productId != null && (actionForm.equals("updateProductComponent") || actionForm.equals("EditProductComponent"))){ - workEffortId = request.getParameter("workEffortId"); - List productComponents = delegator.findByAnd("WorkEffortGoodStandard", UtilMisc.toMap("workEffortId", workEffortId, "workEffortGoodStdTypeId", "PRUNT_PROD_NEEDED", "productId",productId)); - GenericValue productComponent = EntityUtil.getFirst(productComponents); - Map productComponentData = productComponent.getAllFields(); - productComponentData.put("productionRunId", productionRunId); - internalName = productComponent.getRelatedOne("Product").getString("internalName"); - productComponentData.put("internalName",internalName); - HtmlFormWrapper editPrProductComponentWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "EditProductionRunComponent", request, response); - editPrProductComponentWrapper.putInContext("productComponentData", productComponentData); - editPrProductComponentWrapper.putInContext("actionForm", "updateProductComponent"); - editPrProductComponentWrapper.putInContext("actionIsAdd", "null"); - context.put("editPrProductComponentWrapper",editPrProductComponentWrapper); - context.put("productId",productId); - } // Product component/parts list - List productionRunComponents = productionRun.getProductionRunComponents(); - List productionRunComponentsData = new LinkedList(); - if (productionRunComponents != null){ - GenericValue component; - for (Iterator iter=productionRunComponents.iterator(); iter.hasNext();){ - component = (GenericValue) iter.next(); - String componentName = component.getRelatedOne("Product").getString("internalName"); - String workEffortName = component.getRelatedOne("WorkEffort").getString("workEffortName"); - Map componentData = component.getAllFields(); - componentData.put("internalName", componentName); - componentData.put("workEffortName", workEffortName); - productionRunComponentsData.add(componentData); - } - } - HtmlFormWrapper ListProductionRunComponentsWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "ListProductionRunComponents", request, response); - ListProductionRunComponentsWrapper.putInContext("productionRunId", productionRunId); - ListProductionRunComponentsWrapper.putInContext("productionRunComponentsData", productionRunComponentsData); - context.put("ListProductionRunComponentsWrapper",ListProductionRunComponentsWrapper); - + List productionRunComponentsData = productionRun.getProductionRunComponents(); + context.put("productionRunComponents", productionRunComponentsData); + //------------------------ // Machines (fixed assets) //------------------------ @@ -235,11 +188,7 @@ if (!UtilValidate.isEmpty(productionRunId)) { List taskFixedAssets = prodRunTask.getRelated("WorkEffortFixedAssetAssign"); productionRunFixedAssetsData.addAll(taskFixedAssets); } - HtmlFormWrapper ListProductionRunFixedAssetsWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "ListProductionRunTaskFixedAssets", request, response); - ListProductionRunFixedAssetsWrapper.putInContext("productionRunId", productionRunId); - ListProductionRunFixedAssetsWrapper.putInContext("productionRunFixedAssetsData", productionRunFixedAssetsData); - ListProductionRunFixedAssetsWrapper.putInContext("declarationScreen", "N"); - context.put("ListProductionRunFixedAssetsWrapper", ListProductionRunFixedAssetsWrapper); + context.put("productionRunFixedAssetsData", productionRunFixedAssetsData); } } @@ -253,4 +202,3 @@ errorMessage = request.getAttribute("_ERROR_MESSAGE_"); if (errorMessage != null && errorMessage.length() > 0) { tryEntity = false; } - diff --git a/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunComponents.bsh b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunComponents.bsh new file mode 100644 index 0000000000..9bea10eaf1 --- /dev/null +++ b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunComponents.bsh @@ -0,0 +1,46 @@ +/* + * 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.List; +import java.util.Iterator; +import java.util.ArrayList; + +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 taskComponents = 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 components = delegator.findByAnd("WorkEffortGoodStandard", UtilMisc.toMap("workEffortId", task.getString("workEffortId"))); + HtmlFormWrapper taskComponentsForm = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "ProductionRunTaskComponents", request, response); + taskComponentsForm.putInContext("taskComponents", components); + taskComponents.add(UtilMisc.toMap("task", task, "componentsForm", taskComponentsForm)); +} +context.put("taskComponents", taskComponents); diff --git a/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh index 65b4767711..ef1e83d1a1 100644 --- a/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh +++ b/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/ProductionRunDeclaration.bsh @@ -197,26 +197,6 @@ if (!UtilValidate.isEmpty(productionRunId)) { context.put("ListProductionRunRoutingTasksWrapper",ListProductionRunRoutingTasksWrapper); context.put("productionRunRoutingTasks", productionRunRoutingTasks); - //--------------- - // Components - //--------------- - // Product component update sub-screen - productId = request.getParameter("productId"); - if (productId != null && (actionForm.equals("updateProductComponent") || actionForm.equals("EditProductComponent"))){ - workEffortId = request.getParameter("workEffortId"); - List productComponents = delegator.findByAnd("WorkEffortGoodStandard", UtilMisc.toMap("workEffortId", workEffortId, "workEffortGoodStdTypeId", "PRUNT_PROD_NEEDED", "productId",productId)); - GenericValue productComponent = EntityUtil.getFirst(productComponents); - Map productComponentData = productComponent.getAllFields(); - productComponentData.put("productionRunId", productionRunId); - internalName = productComponent.getRelatedOne("Product").getString("internalName"); - productComponentData.put("internalName",internalName); - HtmlFormWrapper editPrProductComponentWrapper = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "EditProductionRunComponent", request, response); - editPrProductComponentWrapper.putInContext("productComponentData", productComponentData); - editPrProductComponentWrapper.putInContext("actionForm", "updateProductComponent"); - editPrProductComponentWrapper.putInContext("uiLabelButton",request.getAttribute("uiLabelMap").get("CommonUpdate")); - context.put("editPrProductComponentWrapper",editPrProductComponentWrapper); - context.put("productId",productId); - } // Product components list List productionRunComponents = productionRun.getProductionRunComponents(); List productionRunComponentsData = new LinkedList(); diff --git a/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml b/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml index eb272b087e..602f2931d3 100644 --- a/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml +++ b/applications/manufacturing/webapp/manufacturing/WEB-INF/controller.xml @@ -511,6 +511,28 @@ under the License. + + + + + + + + + + + + + + + + + + + + + + @@ -533,12 +555,6 @@ under the License. - - - - - - @@ -735,6 +751,7 @@ under the License. + diff --git a/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl b/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl index ff8ace2749..5381594581 100644 --- a/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl +++ b/applications/manufacturing/webapp/manufacturing/jobshopmgt/EditProductionRun.ftl @@ -122,27 +122,6 @@ under the License. - - <#-- Product component sub-screen Update or Add --> - <#if productId?has_content || actionForm=="AddProductComponent"> - -   - - - -
- - - <#if productId?has_content> <#-- Product component Update --> - - <#else> <#-- Product component Add --> - - - -
${uiLabelMap.CommonEdit} ${uiLabelMap.ManufacturingProductionRunProductComponent} : ${productId}
${uiLabelMap.ManufacturingAddProductionRunProductComponent}
- ${editPrProductComponentWrapper.renderFormString(context)} -
- <#-- Fixed Asset assign sub-screen Update or Add --> <#if fixedAssetId?has_content || actionForm=="AddFixedAsset"> @@ -168,53 +147,6 @@ under the License.
- <#-- List Of ProductionRun RoutingTasks sub-screen --> - - -
- - - - - -
${uiLabelMap.ManufacturingListOfProductionRunRoutingTasks}
- - ${uiLabelMap.ManufacturingAddRoutingTask} -
- ${ListProductionRunRoutingTasksWrapper.renderFormString(context)} -
- - <#-- List Of ProductionRun Components sub-screen --> - - -
- - - - - -
${uiLabelMap.ManufacturingListOfProductionRunComponents}
- - ${uiLabelMap.ManufacturingAddProductionRunProductComponent} -
- ${ListProductionRunComponentsWrapper.renderFormString(context)} -
- - <#-- List of ProductionRun Fixed Assets sub-screen --> - - -
- - - - - -
${uiLabelMap.ManufacturingListOfProductionRunFixedAssets}
- - ${uiLabelMap.ManufacturingAddProductionRunFixedAssetAssign} -
- ${ListProductionRunFixedAssetsWrapper.renderFormString(context)} -
<#else>

${uiLabelMap.ManufacturingNoProductionRunSelected}

diff --git a/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunComponents.ftl b/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunComponents.ftl new file mode 100644 index 0000000000..05f77edea9 --- /dev/null +++ b/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunComponents.ftl @@ -0,0 +1,29 @@ +<#-- +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. +--> + +
+<#list taskComponents as taskComponent> + <#assign task = taskComponent.task> + <#assign componentsForm = taskComponent.componentsForm> +
+ ${task.workEffortName?if_exists} [${task.workEffortId}] +
+ ${componentsForm.renderFormString(context)} +
+ diff --git a/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml b/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml index 919aebc955..5abdf90810 100644 --- a/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml +++ b/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml @@ -121,21 +121,14 @@ under the License. -
+ - + - - + + - - - - - - -
@@ -177,43 +170,6 @@ under the License.
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
@@ -395,11 +351,10 @@ under the License. -
- + - + @@ -563,4 +518,33 @@ under the License. +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
diff --git a/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl b/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl index 0546b987c8..bf1d486bac 100644 --- a/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl +++ b/applications/manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunTabBar.ftl @@ -28,6 +28,7 @@ under the License. ${uiLabelMap.ManufacturingProductionRunDeclaration} ${uiLabelMap.ManufacturingActualCosts} + ${uiLabelMap.ManufacturingMaterials} ${uiLabelMap.ManufacturingProductionRunAssocs} diff --git a/applications/manufacturing/widget/manufacturing/JobshopScreens.xml b/applications/manufacturing/widget/manufacturing/JobshopScreens.xml index 32a4fcce7a..74e7c04bc8 100644 --- a/applications/manufacturing/widget/manufacturing/JobshopScreens.xml +++ b/applications/manufacturing/widget/manufacturing/JobshopScreens.xml @@ -81,6 +81,8 @@ under the License. + +