svn commit: r419736 - in /incubator/ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderServices.java src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java webapp/ordermgr/order/appendorderitem.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r419736 - in /incubator/ofbiz/trunk/applications/order: servicedef/services.xml src/org/ofbiz/order/order/OrderServices.java src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java webapp/ordermgr/order/appendorderitem.ftl

sichen
Author: sichen
Date: Thu Jul  6 16:15:27 2006
New Revision: 419736

URL: http://svn.apache.org/viewvc?rev=419736&view=rev
Log:
Fixed bug where adding an item to a created order would crash due to inability to compute price.

Modified:
    incubator/ofbiz/trunk/applications/order/servicedef/services.xml
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl

Modified: incubator/ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/services.xml?rev=419736&r1=419735&r2=419736&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ incubator/ofbiz/trunk/applications/order/servicedef/services.xml Thu Jul  6 16:15:27 2006
@@ -249,11 +249,12 @@
         <attribute name="orderId" type="String" mode="INOUT" optional="false"/>
         <attribute name="shipGroupSeqId" type="String" mode="IN" optional="false"/>
         <attribute name="productId" type="String" mode="IN" optional="false"/>
-        <attribute name="overridePrice" type="String" mode="IN" optional="true"/>
+        <attribute name="prodCatalogId" type="String" mode="IN" optional="false"/>
         <attribute name="basePrice" type="Double" mode="IN" optional="true"/>
         <attribute name="quantity" type="Double" mode="IN" optional="false"/>
         <attribute name="amount" type="Double" mode="IN" optional="true"/>
-        <attribute name="overridePrice" type="Boolean" mode="IN" optional="true"/>
+        <attribute name="overridePrice" type="String" mode="IN" optional="true"/>
+        <attribute name="prodCatalogId" type="String" mode="IN" optional="true"/>
         <attribute name="shoppingCart" type="org.ofbiz.order.shoppingcart.ShoppingCart" mode="OUT" optional="false"/>
     </service>
 

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=419736&r1=419735&r2=419736&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Jul  6 16:15:27 2006
@@ -59,6 +59,7 @@
 import org.ofbiz.order.shoppingcart.shipping.ShippingEvents;
 import org.ofbiz.party.contact.ContactHelper;
 import org.ofbiz.party.party.PartyWorker;
+import org.ofbiz.product.catalog.CatalogWorker;
 import org.ofbiz.product.product.ProductContentWrapper;
 import org.ofbiz.product.product.ProductWorker;
 import org.ofbiz.product.store.ProductStoreWorker;
@@ -2822,10 +2823,11 @@
         String shipGroupSeqId = (String) context.get("shipGroupSeqId");
         String orderId = (String) context.get("orderId");
         String productId = (String) context.get("productId");
+        String prodCatalogId = (String) context.get("prodCatalogId");
         Double basePrice = (Double) context.get("basePrice");
         Double quantity = (Double) context.get("quantity");
         Double amount = (Double) context.get("amount");
-        Boolean overridePrice = (Boolean) context.get("overridePrice");
+        String overridePrice = (String) context.get("overridePrice");
 
         if (amount == null) {
             amount = new Double(0.00);

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java?rev=419736&r1=419735&r2=419736&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartItem.java Thu Jul  6 16:15:27 2006
@@ -454,6 +454,7 @@
         try {
             newItem.setQuantity(quantity, dispatcher, cart, triggerExternalOps, true, triggerPriceRules);
         } catch (CartItemModifyException e) {
+            Debug.logWarning(e.getMessage(), module);
             cart.removeCartItem(cart.getItemIndex(newItem), dispatcher);
             cart.clearItemShipInfo(newItem);
             cart.removeEmptyCartItems();

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl?rev=419736&r1=419735&r2=419736&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/appendorderitem.ftl Thu Jul  6 16:15:27 2006
@@ -43,6 +43,8 @@
           <tr>
             <td>
               <form method="post" action="<@ofbizUrl>appendItemToOrder?${paramString}</@ofbizUrl>" name="appendItemForm" style="margin: 0;">
+              <#-- TODO: Presently, this is the ofbiz way of getting the prodCatalog, which is not generic. Replace with a selecatble list defaulting to this instead -->
+              <input type="hidden" name="prodCatalogId" value="${Static["org.ofbiz.product.catalog.CatalogWorker"].getCurrentCatalogId(request)}"/>
               <table border="0">
                 <tr>
                   <td align="right"><div class="tableheadtext">${uiLabelMap.ProductProductId} :</div></td>