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 2010/04/07 10:15:23 UTC

svn commit: r931459 - in /ofbiz/trunk/applications/order: config/OrderUiLabels.xml src/org/ofbiz/order/order/OrderServices.java

Author: ashish
Date: Wed Apr  7 08:15:23 2010
New Revision: 931459

URL: http://svn.apache.org/viewvc?rev=931459&view=rev
Log:
Applied patch from jira issue OFBIZ-3655 - When Order Items are cancelled, at the time of editing the order, system should generate Order Note in Order Detail Page.
Thanks Divesh for the contribution.

Also fixed typo in your patch:
canceled -> cancelled

Modified:
    ofbiz/trunk/applications/order/config/OrderUiLabels.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java

Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.xml?rev=931459&r1=931458&r2=931459&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original)
+++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Wed Apr  7 08:15:23 2010
@@ -1951,6 +1951,9 @@
         <value xml:lang="zh">取消全部明细</value>
         <value xml:lang="zh_CN">取消所有项目</value>
     </property>
+    <property key="OrderCancelledItemToOrder">
+        <value xml:lang="en">Cancelled item to order: </value>
+    </property>
     <property key="OrderCancelOrder">
         <value xml:lang="de">Auftrag annullieren</value>
         <value xml:lang="en">Cancel Order</value>

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=931459&r1=931458&r2=931459&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 Wed Apr  7 08:15:23 2010
@@ -1963,6 +1963,16 @@ public class OrderServices {
                             return ServiceUtil.returnError((String)resp.get(ModelService.ERROR_MESSAGE));
                         }
                     }
+                    
+                    // log an order note
+                    try {
+                        BigDecimal quantity = thisCancelQty.setScale(1, orderRounding);
+                        String cancelledItemToOrder = UtilProperties.getMessage(resource, "OrderCancelledItemToOrder", locale);
+                        dispatcher.runSync("createOrderNote", UtilMisc.<String, Object>toMap("orderId", orderId, "note", cancelledItemToOrder +
+                                orderItem.getString("productId") + " (" + quantity + ")", "internalNote", "Y", "userLogin", userLogin));
+                    } catch (GenericServiceException e) {
+                        Debug.logError(e, module);
+                    }
 
                     if (thisCancelQty.compareTo(itemQuantity) >= 0) {
                         // all items are cancelled -- mark the item as cancelled