You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2012/05/22 08:27:20 UTC

svn commit: r1341314 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java

Author: jacopoc
Date: Tue May 22 06:27:19 2012
New Revision: 1341314

URL: http://svn.apache.org/viewvc?rev=1341314&view=rev
Log:
Fixed error reported in OFBIZ-4892: in orders with more than one promo codes, only one code was stored in OrderProductPromoCode entity.
Thanks to Ritu Raj Lakhera for the report and the patch; the one I have committed fixes the bug in a slightly different way.

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

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=1341314&r1=1341313&r2=1341314&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 Tue May 22 06:27:19 2012
@@ -924,9 +924,8 @@ public class OrderServices {
         // store the orderProductPromoCodes
         Set<String> orderProductPromoCodes = UtilGenerics.checkSet(context.get("orderProductPromoCodes"));
         if (UtilValidate.isNotEmpty(orderProductPromoCodes)) {
-            GenericValue orderProductPromoCode = delegator.makeValue("OrderProductPromoCode");
             for(String productPromoCodeId : orderProductPromoCodes) {
-                orderProductPromoCode.clear();
+                GenericValue orderProductPromoCode = delegator.makeValue("OrderProductPromoCode");
                 orderProductPromoCode.set("orderId", orderId);
                 orderProductPromoCode.set("productPromoCodeId", productPromoCodeId);
                 toBeStored.add(orderProductPromoCode);