Author: jacopoc
Date: Thu Nov 26 14:26:14 2009 New Revision: 884564 URL: http://svn.apache.org/viewvc?rev=884564&view=rev Log: Cleaned up the "work with shipment plan" screen. Fixed a few bugs. Removed: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/jobshopmgt/WorkWithShipmentPlans.ftl Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml Modified: ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy?rev=884564&r1=884563&r2=884564&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy (original) +++ ofbiz/trunk/applications/manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy Thu Nov 26 14:26:14 2009 @@ -17,27 +17,17 @@ * under the License. */ -import org.ofbiz.widget.html.HtmlFormWrapper; - -shipmentId = parameters.shipmentId ?: context.get("shipmentId"); - -action = parameters.action; - -shipment = null; -if (shipmentId) { - shipment = delegator.findByPrimaryKey("Shipment", [shipmentId : shipmentId]); -} // ************************************** // ShipmentPlan list form // ************************************** shipmentPlans = []; rows = []; -if (shipment) { +if (shipment && shipment.shipmentId) { shipmentPlans = delegator.findByAnd("OrderShipment", [shipmentId : shipment.shipmentId]); } if (shipmentPlans) { - boolean workInProgress = false; + workInProgress = "false"; shipmentPlans.each { shipmentPlan -> oneRow = new HashMap(shipmentPlan); // oneRow.putAll(shipmentPlan.getRelatedOne("OrderItemInventoryRes")); @@ -92,15 +82,15 @@ if (qtyPlannedInShipment.containsKey(plan.shipmentId)) { qtyInShipment = qtyPlannedInShipment[plan.shipmentId]; qtyInShipment += netPlanQty; - qtyPlannedInShipment.plan.shipmentId = qtyInShipment; + qtyPlannedInShipment[plan.shipmentId] = qtyInShipment; } else { - qtyPlannedInShipment.plan.shipmentId = netPlanQty; + qtyPlannedInShipment[plan.shipmentId] = netPlanQty; } } } oneRow.totPlannedQuantity = plannedQuantity; - if (qtyIssuedInShipment.containsKey(shipmentId)) { - oneRow.issuedQuantity = qtyIssuedInShipment.get(shipmentId); + if (qtyIssuedInShipment.containsKey(shipmentPlan.shipmentId)) { + oneRow.issuedQuantity = qtyIssuedInShipment.get(shipmentPlan.shipmentId); } else { oneRow.issuedQuantity = ""; } @@ -157,7 +147,8 @@ // Select the production runs, if available productionRuns = delegator.findByAnd("WorkOrderItemFulfillment", [orderId : shipmentPlan.orderId , orderItemSeqId : shipmentPlan.orderItemSeqId],["workEffortId"]); // TODO: add shipmentId if (productionRuns) { - workInProgress = true; + workInProgress = "true"; + productionRunsId = ""; productionRuns.each { productionRun -> productionRunsId = productionRun.workEffortId + " " + productionRunsId; } @@ -167,21 +158,5 @@ rows.add(oneRow); } context.workInProgress = workInProgress; - HtmlFormWrapper listShipmentPlanForm = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "listShipmentPlan", request, response); - listShipmentPlanForm.putInContext("shipmentPlan", rows); - context.listShipmentPlanForm = listShipmentPlanForm; // Form for ShipmentPlan list -} else { - shipments = []; - scheduledShipments = delegator.findByAndCache("Shipment", [shipmentTypeId : "SALES_SHIPMENT", statusId : "SHIPMENT_SCHEDULED"]); - scheduledShipments.each { scheduledShipment -> - shipments.add(scheduledShipment); - } - //List confirmedShipments = delegator.findByAndCache("Shipment", UtilMisc.toMap("shipmentTypeId", "SALES_SHIPMENT", "statusId", "SCHEDULED_CONFIRMED")); - - HtmlFormWrapper listShipmentPlansForm = new HtmlFormWrapper("component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml", "listShipmentPlans", request, response); - listShipmentPlansForm.putInContext("shipmentPlans", shipments); - context.listShipmentPlansForm = listShipmentPlansForm; + context.shipmentPlan = rows; } -context.shipmentId = shipmentId; -context.shipment = shipment; - Modified: ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml?rev=884564&r1=884563&r2=884564&view=diff ============================================================================== --- ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml (original) +++ ofbiz/trunk/applications/manufacturing/widget/manufacturing/JobshopScreens.xml Thu Nov 26 14:26:14 2009 @@ -544,15 +544,56 @@ <actions> <set field="titleProperty" value="ManufacturingWorkWithShipmentPlans"/> <set field="headerItem" value="ShipmentPlans"/> - + <set field="shipmentId" from-field="parameters.shipmentId"/> + <entity-one entity-name="Shipment" value-field="shipment"/> + <entity-condition entity-name="Shipment" list="shipmentPlans"> + <condition-list> + <condition-expr field-name="shipmentTypeId" value="SALES_SHIPMENT"/> + <condition-expr field-name="statusId" value="SHIPMENT_SCHEDULED"/> + </condition-list> + </entity-condition> <script location="component://manufacturing/webapp/manufacturing/WEB-INF/actions/jobshopmgt/WorkWithShipmentPlans.groovy"/> </actions> <widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> <decorator-section name="body"> - <platform-specific> - <html><html-template location="component://manufacturing/webapp/manufacturing/jobshopmgt/WorkWithShipmentPlans.ftl"/></html> - </platform-specific> + <screenlet title="${uiLabelMap.ManufacturingWorkWithShipmentPlans}"> + <include-form name="listShipmentPlans" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/> + </screenlet> + <section> + <condition> + <not><if-empty field="shipment"/></not> + </condition> + <widgets> + <screenlet title="${uiLabelMap.FormFieldTitle_shipmentId} ${shipment.shipmentId}"> + <include-form name="listShipmentPlan" location="component://manufacturing/webapp/manufacturing/jobshopmgt/ProductionRunForms.xml"/> + </screenlet> + <section> + <condition> + <if-compare field="workInProgress" operator="equals" value="true"/> + </condition> + <widgets> + <link text="${uiLabelMap.ManufacturingTasksReport}" style="buttontext" target="ShipmentWorkEffortTasks.pdf"> + <parameter param-name="shipmentId" from-field="shipment.shipmentId"/> + </link> + <link text="${uiLabelMap.ManufacturingCuttingListReport}" style="buttontext" target="CuttingListReport.pdf"> + <parameter param-name="shipmentId" from-field="shipment.shipmentId"/> + </link> + </widgets> + <fail-widgets> + <link text="${uiLabelMap.ManufacturingCreateProductionRun}" style="buttontext" target="createProductionRunsForShipment"> + <parameter param-name="shipmentId" from-field="shipment.shipmentId"/> + </link> + <link text="${uiLabelMap.ManufacturingShipmentPlanStockReport}" style="buttontext" target="ShipmentPlanStockReport.pdf"> + <parameter param-name="shipmentId" from-field="shipment.shipmentId"/> + </link> + </fail-widgets> + </section> + <link text="${uiLabelMap.ManufacturingPackageLabelsReport}" style="buttontext" target="ShipmentLabel.pdf"> + <parameter param-name="shipmentId" from-field="shipment.shipmentId"/> + </link> + </widgets> + </section> </decorator-section> </decorator-screen> </widgets> |
Free forum by Nabble | Edit this page |