Author: ashish
Date: Thu Apr 26 18:37:39 2012
New Revision: 1331021
URL: http://svn.apache.org/viewvc?rev=1331021&view=rev
Log:
Applied fix from trunk r1331020.
Bug fix - OFBIZ-4732 - Not able to add Order Item Type for PO while adding item
to existing PO.
If we are creating PO then user can add order item type from show cart screen,
so there should be an option to add order item type while adding item to
existing PO on edit item screen.
Thanks Deepak.
Modified:
ofbiz/branches/release11.04/applications/order/servicedef/services.xml
ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
ofbiz/branches/release11.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
ofbiz/branches/release11.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl
Modified: ofbiz/branches/release11.04/applications/order/servicedef/services.xml
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/order/servicedef/services.xml?rev=1331021&r1=1331020&r2=1331021&view=diff
==============================================================================
--- ofbiz/branches/release11.04/applications/order/servicedef/services.xml
(original)
+++ ofbiz/branches/release11.04/applications/order/servicedef/services.xml Thu
Apr 26 18:37:39 2012
@@ -358,6 +358,7 @@ under the License.
<attribute name="amount" type="BigDecimal" mode="IN" optional="true"/>
<attribute name="overridePrice" type="String" mode="IN"
optional="true"/>
<attribute name="reasonEnumId" type="String" mode="IN"
optional="true"/>
+ <attribute name="orderItemTypeId" type="String" mode="IN"
optional="true"/>
<attribute name="changeComments" type="String" mode="IN"
optional="true"/>
<attribute name="itemDesiredDeliveryDate" type="Timestamp" mode="IN"
optional="true"/>
<attribute name="itemAttributesMap" type="Map" mode="IN"
optional="true"/>
Modified:
ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1331021&r1=1331020&r2=1331021&view=diff
==============================================================================
---
ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
(original)
+++
ofbiz/branches/release11.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
Thu Apr 26 18:37:39 2012
@@ -3415,6 +3415,7 @@ public class OrderServices {
Timestamp itemDesiredDeliveryDate = (Timestamp)
context.get("itemDesiredDeliveryDate");
String overridePrice = (String) context.get("overridePrice");
String reasonEnumId = (String) context.get("reasonEnumId");
+ String orderItemTypeId = (String) context.get("orderItemTypeId");
String changeComments = (String) context.get("changeComments");
Boolean calcTax = (Boolean) context.get("calcTax");
if (calcTax == null) {
@@ -3456,7 +3457,7 @@ public class OrderServices {
GenericValue supplierProduct =
cart.getSupplierProduct(productId, quantity, dispatcher);
ShoppingCartItem item = null;
if (supplierProduct != null) {
- item = ShoppingCartItem.makePurchaseOrderItem(null,
productId, null, quantity, null, null, prodCatalogId, null, null, null,
dispatcher, cart, supplierProduct, itemDesiredDeliveryDate,
itemDesiredDeliveryDate, null);
+ item = ShoppingCartItem.makePurchaseOrderItem(null,
productId, null, quantity, null, null, prodCatalogId, null, orderItemTypeId,
null, dispatcher, cart, supplierProduct, itemDesiredDeliveryDate,
itemDesiredDeliveryDate, null);
cart.addItem(0, item);
} else {
throw new CartItemModifyException("No supplier information
found for product [" + productId + "] and quantity quantity [" + quantity + "],
cannot add to cart.");
Modified:
ofbiz/branches/release11.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=1331021&r1=1331020&r2=1331021&view=diff
==============================================================================
---
ofbiz/branches/release11.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
(original)
+++
ofbiz/branches/release11.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
Thu Apr 26 18:37:39 2012
@@ -251,6 +251,9 @@ if (orderHeader) {
}
}
}
+ // get purchase order item types
+ purchaseOrderItemTypeList = delegator.findByAndCache("OrderItemType",
[parentTypeId : "PURCHASE_SPECIFIC"]);
+ context.purchaseOrderItemTypeList = purchaseOrderItemTypeList;
}
// see if an approved order with all items completed exists
Modified:
ofbiz/branches/release11.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release11.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl?rev=1331021&r1=1331020&r2=1331021&view=diff
==============================================================================
---
ofbiz/branches/release11.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl
(original)
+++
ofbiz/branches/release11.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl
Thu Apr 26 18:37:39 2012
@@ -105,6 +105,19 @@ under the License.
</select>
</td>
</tr>
+ <#if orderHeader.orderTypeId == "PURCHASE_ORDER" &&
purchaseOrderItemTypeList?has_content>
+ <tr>
+ <td class="label">${uiLabelMap.OrderOrderItemType}</td>
+ <td>
+ <select name="orderItemTypeId">
+ <option value=""> </option>
+ <#list purchaseOrderItemTypeList as orderItemType>
+ <option
value="${orderItemType.orderItemTypeId}">${orderItemType.description}</option>
+ </#list>
+ </select>
+ </td>
+ </tr>
+ </#if>
<tr>
<td class="label">${uiLabelMap.CommonComment}</td>
<td>