This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 7c6d5080cf Fixed: Canceling an item from the order view and refreshing 
the page caused promotional items to endlessly duplicate in the ITEM_CREATED 
status. (#1142)
7c6d5080cf is described below

commit 7c6d5080cf88826083c0459ab9cdc3055beec1a9
Author: Jacques Le Roux <[email protected]>
AuthorDate: Wed Apr 29 08:05:39 2026 +0200

    Fixed: Canceling an item from the order view and refreshing the page caused
    promotional items to endlessly duplicate in the ITEM_CREATED status. (#1142)
    
    Fixes 4 Codenarc issues
---
 .../org/apache/ofbiz/order/order/OrderServicesScript.groovy  | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy
 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy
index d4e755c41b..7842255705 100644
--- 
a/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy
+++ 
b/applications/order/src/main/groovy/org/apache/ofbiz/order/order/OrderServicesScript.groovy
@@ -18,6 +18,8 @@
 */
 package org.apache.ofbiz.order.order
 
+import java.sql.Timestamp
+
 import org.apache.ofbiz.base.util.GeneralException
 import org.apache.ofbiz.base.util.ObjectType
 import org.apache.ofbiz.base.util.UtilDateTime
@@ -28,9 +30,9 @@ import 
org.apache.ofbiz.entity.condition.EntityConditionBuilder
 import org.apache.ofbiz.entity.condition.EntityOperator
 import org.apache.ofbiz.order.customer.CheckoutMapProcs
 import org.apache.ofbiz.order.shoppingcart.ShoppingCart
+import org.apache.ofbiz.order.shoppingcart.ShoppingCart.CartShipInfo
 import org.apache.ofbiz.order.shoppingcart.ShoppingCartItem
 
-import java.sql.Timestamp
 /**
  * Service to create OrderHeader
  */
@@ -213,7 +215,7 @@ Map recreateOrderAdjustments() {
             // a new order item is created
             GenericValue newOrderItem = makeValue('OrderItem')
             newOrderItem.with {
-                orderId = order.get("orderId")
+                orderId = order.get('orderId')
                 orderItemTypeId = item.getItemType()
                 selectedAmount = item.getSelectedAmount()
                 unitPrice = item.getBasePrice()
@@ -232,14 +234,14 @@ Map recreateOrderAdjustments() {
             // create the OrderItemShipGroupAssoc
             int itemIndex = cart.getItemIndex(item)
             int shipGroupIndex = cart.getItemShipGroupIndex(itemIndex)
-            def csi = cart.getShipInfo(shipGroupIndex)
-            String shipGroupSeqId = csi.getShipGroupSeqId()
+            CartShipInfo csi = cart.getShipInfo(shipGroupIndex)
+            String shipGroupSeqIdExt = csi.getShipGroupSeqId()
 
             GenericValue newOisga = makeValue('OrderItemShipGroupAssoc')
             newOisga.with {
                 orderId = order.orderId
                 orderItemSeqId = newOrderItem.orderItemSeqId
-                shipGroupSeqId = shipGroupSeqId
+                shipGroupSeqId = shipGroupSeqIdExt
                 quantity = newOrderItem.quantity
             }
             newOisga.create()

Reply via email to