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

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


The following commit(s) were added to refs/heads/release22.01 by this push:
     new 71e0a2cbb4 Fixed: Service getNextOrderId failed if a customMethod is 
present (OFBIZ-12651)
71e0a2cbb4 is described below

commit 71e0a2cbb4bb0e26edcd4ab45d0053e175288894
Author: Nicolas Malin <nicolas.ma...@nereide.fr>
AuthorDate: Fri Jun 17 13:45:03 2022 +0200

    Fixed: Service getNextOrderId failed if a customMethod is present 
(OFBIZ-12651)
    
    When you generate an order on a party who have a PartyAcctgPreference with 
a customMethod orderSequence_enforced, the service failed due to the missing 
parameter partyAcctgPreference.
    
    Like quote and invoice it's preferable to forward the partyAcctgPreference 
information.
---
 applications/order/groovyScripts/order/OrderServices.groovy | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/applications/order/groovyScripts/order/OrderServices.groovy 
b/applications/order/groovyScripts/order/OrderServices.groovy
index f9d043b5dc..a9975ab1cf 100644
--- a/applications/order/groovyScripts/order/OrderServices.groovy
+++ b/applications/order/groovyScripts/order/OrderServices.groovy
@@ -47,9 +47,10 @@ def getNextOrderId() {
         customMethodName = 'orderSequence_enforced'
     }
 
+    String orderIdTemp
     if (customMethodName) {
-        Map customMethodMap = [*: parameters]
-        Map result = run service: customMethodName, with: customMethodMap
+        parameters.partyAcctgPreference = partyAcctgPreference
+        Map result = run service: customMethodName, with: parameters
         orderIdTemp = result.orderId
     } else {
         logInfo 'In getNextOrderId sequence by Standard'
@@ -68,10 +69,7 @@ def getNextOrderId() {
     if (partyAcctgPreference) orderId += partyAcctgPreference.orderIdPrefix ?: 
""
     orderId += orderIdTemp.toString()
 
-    Map result = success()
-    result.orderId = orderId
-
-    return result
+    return success([orderId: orderId])
 }
 
 /**

Reply via email to