Author: jacopoc
Date: Sat Jan 2 11:34:43 2010
New Revision: 895175
URL: http://svn.apache.org/viewvc?rev=895175&view=rev
Log:
Converted "shipment plan" screen to widgets; enhanced the page to be reused for
purchase orders (upcoming new feature).
Removed:
ofbiz/trunk/applications/product/webapp/facility/shipment/EditShipmentPlan.ftl
Modified:
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.groovy
ofbiz/trunk/applications/product/widget/facility/ShipmentForms.xml
ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml
Modified:
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.groovy?rev=895175&r1=895174&r2=895175&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.groovy
(original)
+++
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentPlan.groovy
Sat Jan 2 11:34:43 2010
@@ -43,13 +43,10 @@
// Search method: search by productId
// **************************************
if (action && orderId) {
- orderHeader = delegator.findOne("OrderHeader", [orderId : orderId], false);
- if (orderHeader && "SALES_ORDER".equals(orderHeader.orderTypeId)) {
- if (shipGroupSeqId) {
- orderItemShipGroupAssocs =
delegator.findList("OrderItemShipGroupAssoc",
EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId :
shipGroupSeqId]), null, null, null, false);
- } else {
- orderItemShipGroupAssocs =
delegator.findList("OrderItemShipGroupAssoc",
EntityCondition.makeCondition([orderId : orderId]), null, null, null, false);
- }
+ if (shipGroupSeqId) {
+ orderItemShipGroupAssocs =
delegator.findList("OrderItemShipGroupAssoc",
EntityCondition.makeCondition([orderId : orderId, shipGroupSeqId :
shipGroupSeqId]), null, null, null, false);
+ } else {
+ orderItemShipGroupAssocs =
delegator.findList("OrderItemShipGroupAssoc",
EntityCondition.makeCondition([orderId : orderId]), null, null, null, false);
}
}
@@ -186,8 +183,6 @@
rows.add(oneRow);
}
}
-HtmlFormWrapper listShipmentPlanForm = new
HtmlFormWrapper("component://product/widget/facility//ShipmentForms.xml",
"listShipmentPlan", request, response);
-listShipmentPlanForm.putInContext("shipmentPlan", rows);
// **************************************
// ShipmentPlan add form
@@ -198,8 +193,9 @@
orderItem = orderItemShipGroupAssoc.getRelatedOne("OrderItem");
oneRow = [:];
oneRow.shipmentId = shipmentId;
- oneRow.orderId = orderItem.orderId;
- oneRow.orderItemSeqId = orderItem.orderItemSeqId;
+ oneRow.orderId = orderItemShipGroupAssoc.orderId;
+ oneRow.orderItemSeqId = orderItemShipGroupAssoc.orderItemSeqId;
+ oneRow.shipGroupSeqId = orderItemShipGroupAssoc.shipGroupSeqId;
oneRow.productId = orderItem.productId;
orderedQuantity = orderItemShipGroupAssoc.getDouble("quantity");
canceledQuantity = orderItemShipGroupAssoc.getDouble("cancelQuantity");
@@ -233,7 +229,13 @@
oneRow.issuedQuantity = issuedQuantity;
// Total quantity planned not issued
plannedQuantity = 0.0;
- plans = delegator.findList("OrderShipment",
EntityCondition.makeCondition([orderId : orderItem.orderId, orderItemSeqId :
orderItem.orderItemSeqId]), null, null, null, false);
+ EntityCondition orderShipmentCondition = null;
+ if (shipGroupSeqId) {
+ orderShipmentCondition = EntityCondition.makeCondition([orderId :
orderItemShipGroupAssoc.orderId, orderItemSeqId :
orderItemShipGroupAssoc.orderItemSeqId, shipGroupSeqId :
orderItemShipGroupAssoc.shipGroupSeqId]);
+ } else {
+ orderShipmentCondition = EntityCondition.makeCondition([orderId :
orderItemShipGroupAssoc.orderId, orderItemSeqId :
orderItemShipGroupAssoc.orderItemSeqId]);
+ }
+ plans = delegator.findList("OrderShipment", orderShipmentCondition,
null, null, null, false);
plans.each { plan ->
if (plan.quantity) {
netPlanQty = plan.getDouble("quantity");
@@ -276,27 +278,8 @@
addRows.add(oneRow);
}
}
-// Add form
-HtmlFormWrapper addToShipmentPlanForm = new
HtmlFormWrapper("component://product/widget/facility//ShipmentForms.xml",
"addToShipmentPlan", request, response);
-addToShipmentPlanForm.putInContext("shipmentPlan", addRows);
-
-HtmlFormWrapper findOrderItemsForm = new
HtmlFormWrapper("component://product/widget/facility//ShipmentForms.xml",
"findOrderItems", request, response);
-findOrderItemsForm.putInContext("shipmentId", shipmentId);
-if (shipment && shipment.primaryOrderId) {
- findOrderItemsForm.putInContext("orderId", shipment.primaryOrderId);
- if (shipment.primaryShipGroupSeqId) {
- findOrderItemsForm.putInContext("shipGroupSeqId",
shipment.primaryShipGroupSeqId);
- }
-}
-
-HtmlFormWrapper shipmentPlanToOrderItemsForm = new
HtmlFormWrapper("component://product/widget/facility//ShipmentForms.xml",
"shipmentPlanToOrderItems", request, response);
-shipmentPlanToOrderItemsForm.putInContext("shipmentId", shipmentId);
-context.findOrderItemsForm = findOrderItemsForm; // Form for Order search:
find By orderId
-context.shipmentPlanToOrderItemsForm = shipmentPlanToOrderItemsForm; // From
Shipment Plan to Order Items
-context.listShipmentPlanForm = listShipmentPlanForm; // Form for ShipmentPlan
list
-context.listShipmentPlanRows = shipmentPlans;
-context.addToShipmentPlanForm = addToShipmentPlanForm; // For for ShipmentPlan
entry
+context.listShipmentPlanRows = rows;
context.addToShipmentPlanRows = addRows;
context.rowCount = addRows.size();
context.shipmentId = shipmentId;
Modified: ofbiz/trunk/applications/product/widget/facility/ShipmentForms.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/ShipmentForms.xml?rev=895175&r1=895174&r2=895175&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/ShipmentForms.xml
(original)
+++ ofbiz/trunk/applications/product/widget/facility/ShipmentForms.xml Sat Jan
2 11:34:43 2010
@@ -134,11 +134,12 @@
<!-- Shipment Plan Forms -->
<!-- ******************* -->
<!-- List for Shipment Plan -->
- <form name="listShipmentPlan" type="list" target="" title=""
list-name="shipmentPlan"
+ <form name="listShipmentPlan" type="list" target="" title=""
list-name="listShipmentPlanRows"
odd-row-style="alternate-row" default-table-style="basic-table
hover-bar">
<field name="shipmentItemSeqId"
title="${uiLabelMap.ProductShipmentItemSeqId}"><display/></field>
<field name="orderId"
title="${uiLabelMap.ProductOrderId}"><display/></field>
<field name="orderItemSeqId"
title="${uiLabelMap.ProductOrderItem}"><display/></field>
+ <field name="shipGroupSeqId"><display/></field>
<field name="productId"
title="${uiLabelMap.ProductProductId}"><display/></field>
<!-- quantity planned in this shipment -->
<field name="quantity"
title="${uiLabelMap.ProductQuantity}"><display/></field>
@@ -159,22 +160,23 @@
<field name="volume"
title="${uiLabelMap.CommonVolume}"><display/></field>
<field name="volumeUom"
title="${uiLabelMap.CommonUom}"><display/></field>
<field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}"
widget-style="buttontext">
- <hyperlink target="removeOrderShipmentFromShipment"
description="[${uiLabelMap.CommonDelete}]" also-hidden="false">
+ <hyperlink target="removeOrderShipmentFromShipment"
description="${uiLabelMap.CommonDelete}" also-hidden="false">
<parameter param-name="shipmentId"/>
<parameter param-name="shipmentItemSeqId"/>
<parameter param-name="orderId"/>
<parameter param-name="orderItemSeqId"/>
+ <parameter param-name="shipGroupSeqId"/>
</hyperlink>
</field>
</form>
- <!-- Add entries to Shipment Plan -->
- <form name="addToShipmentPlan" type="multi" target="addToShipmentPlan"
title="" list-name="shipmentPlan"
+ <form name="addToShipmentPlan" type="multi"
target="addToShipmentPlan?shipmentId=${shipmentId}" title=""
list-name="addToShipmentPlanRows"
odd-row-style="alternate-row" default-table-style="basic-table
hover-bar">
<field name="shipmentId"><hidden/></field>
<field name="orderId"><hidden/></field>
<field name="orderItemSeqId"><hidden/></field>
<field name="orderId"
title="${uiLabelMap.ProductOrderId}"><display/></field>
<field name="orderItemSeqId"
title="${uiLabelMap.ProductOrderItem}"><display/></field>
+ <field name="shipGroupSeqId"><display/></field>
<field name="productId"
title="${uiLabelMap.ProductProductId}"><display/></field>
<!-- ordered quantity -->
<field name="orderedQuantity"
title="${uiLabelMap.ProductOrderedQuantity}"><display/></field>
@@ -190,6 +192,9 @@
<!-- planned volume -->
<field name="volume"
title="${uiLabelMap.CommonVolume}"><display/></field>
<field name="volumeUom"
title="${uiLabelMap.CommonUom}"><display/></field>
+ <field name="submitButton" title="${uiLabelMap.CommonAdd}">
+ <submit button-type="button"/>
+ </field>
</form>
<!-- Search by Order Id -->
@@ -197,22 +202,14 @@
header-row-style="header-row" default-table-style="basic-table">
<field name="action"><hidden value="search"/></field>
<field name="shipmentId"><hidden/></field>
- <field name="orderId" title="${uiLabelMap.ProductOrderId}">
+ <field name="orderId" entry-name="shipment.primaryOrderId"
title="${uiLabelMap.ProductOrderId}">
<lookup target-form-name="LookupOrderHeaderAndShipInfo"/>
</field>
- <field name="shipGroupSeqId"><text/></field>
+ <field name="shipGroupSeqId"
entry-name="shipment.primaryShipGroupSeqId"><text/></field>
<field name="submitButton" title="${uiLabelMap.CommonSubmit}">
<submit button-type="button"/>
</field>
</form>
- <form name="shipmentPlanToOrderItems" type="single"
target="AddItemsFromOrder" title=""
- header-row-style="header-row" default-table-style="basic-table">
- <field name="selectFromShipmentPlan"><hidden value="true"/></field>
- <field name="shipmentId"><hidden/></field>
- <field name="submitButton"
title="${uiLabelMap.ProductShipmentPlanToOrderItems}">
- <submit button-type="button"/>
- </field>
- </form>
<form name="ShipmentReceipts" type="list" target="" title=""
list-name="shipmentReceiptList"
odd-row-style="alternate-row" default-table-style="basic-table
hover-bar">
<actions>
Modified: ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml?rev=895175&r1=895174&r2=895175&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml
(original)
+++ ofbiz/trunk/applications/product/widget/facility/ShipmentScreens.xml Sat
Jan 2 11:34:43 2010
@@ -227,9 +227,27 @@
<widgets>
<decorator-screen name="CommonShipmentDecorator">
<decorator-section name="body">
- <platform-specific>
- <html><html-template
location="component://product/webapp/facility/shipment/EditShipmentPlan.ftl"/></html>
- </platform-specific>
+ <screenlet title="${uiLabelMap.ProductShipmentPlan}">
+ <include-form name="findOrderItems"
location="component://product/widget/facility//ShipmentForms.xml"/>
+ </screenlet>
+ <section>
+ <condition>
+ <not><if-empty
field="addToShipmentPlanRows"/></not>
+ </condition>
+ <widgets>
+ <screenlet
title="${uiLabelMap.ProductShipmentPlanAdd}">
+ <include-form name="addToShipmentPlan"
location="component://product/widget/facility//ShipmentForms.xml"/>
+ </screenlet>
+ </widgets>
+ </section>
+ <screenlet
title="${uiLabelMap.ProductShipmentPlanList}">
+ <include-form name="listShipmentPlan"
location="component://product/widget/facility//ShipmentForms.xml"/>
+ <label style="h2"
text="${uiLabelMap.ProductShipmentTotalWeight}: ${totWeight}
${uiLabelMap.ProductShipmentTotalVolume}: ${totVolume}"/>
+ <link
text="${uiLabelMap.ProductShipmentPlanToOrderItems}" target="AddItemsFromOrder">
+ <parameter param-name="shipmentId"/>
+ <parameter param-name="selectFromShipmentPlan"
value="true"/>
+ </link>
+ </screenlet>
</decorator-section>
</decorator-screen>
</widgets>