Author: ashish
Date: Wed Apr 7 08:15:23 2010
New Revision: 931459
URL:
http://svn.apache.org/viewvc?rev=931459&view=revLog:
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