You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2012/04/26 20:36:09 UTC

svn commit: r1331020 - in /ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderServices.java webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy webapp/ordermgr/order/appendorderitem.ftl

Author: ashish
Date: Thu Apr 26 18:36:09 2012
New Revision: 1331020

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

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=1331020&r1=1331019&r2=1331020&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Thu Apr 26 18:36:09 2012
@@ -354,6 +354,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/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=1331020&r1=1331019&r2=1331020&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Apr 26 18:36:09 2012
@@ -3479,6 +3479,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("reasonEnumId");
         String changeComments = (String) context.get("changeComments");
         Boolean calcTax = (Boolean) context.get("calcTax");
         if (calcTax == null) {
@@ -3520,7 +3521,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/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy?rev=1331020&r1=1331019&r2=1331020&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/order/OrderView.groovy Thu Apr 26 18:36:09 2012
@@ -250,6 +250,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/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl?rev=1331020&r1=1331019&r2=1331020&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl Thu Apr 26 18:36:09 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="">&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>