Author: ashish
Date: Thu Apr 26 18:38:28 2012
New Revision: 1331022

URL: http://svn.apache.org/viewvc?rev=1331022&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/release10.04/applications/order/servicedef/services.xml
    
ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
    
ofbiz/branches/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
    
ofbiz/branches/release10.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl

Modified: ofbiz/branches/release10.04/applications/order/servicedef/services.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/servicedef/services.xml?rev=1331022&r1=1331021&r2=1331022&view=diff
==============================================================================
--- ofbiz/branches/release10.04/applications/order/servicedef/services.xml 
(original)
+++ ofbiz/branches/release10.04/applications/order/servicedef/services.xml Thu 
Apr 26 18:38:28 2012
@@ -355,6 +355,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/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1331022&r1=1331021&r2=1331022&view=diff
==============================================================================
--- 
ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
 (original)
+++ 
ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderServices.java
 Thu Apr 26 18:38:28 2012
@@ -3301,6 +3301,7 @@ public class OrderServices {
         String overridePrice = (String) context.get("overridePrice");
         Map itemAttributesMap = (Map) context.get("itemAttributesMap");
         String reasonEnumId = (String) context.get("reasonEnumId");
+        String orderItemTypeId = (String) context.get("orderItemTypeId");
         String changeComments = (String) context.get("changeComments");
 
         if (amount == null) {
@@ -3336,7 +3337,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/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=1331022&r1=1331021&r2=1331022&view=diff
==============================================================================
--- 
ofbiz/branches/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
 (original)
+++ 
ofbiz/branches/release10.04/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
 Thu Apr 26 18:38:28 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/release10.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl?rev=1331022&r1=1331021&r2=1331022&view=diff
==============================================================================
--- 
ofbiz/branches/release10.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl
 (original)
+++ 
ofbiz/branches/release10.04/applications/order/webapp/ordermgr/order/appendorderitem.ftl
 Thu Apr 26 18:38:28 2012
@@ -106,6 +106,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="">&nbsp;</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>


Reply via email to