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

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


The following commit(s) were added to refs/heads/release24.09 by this push:
     new 2c17552d6b Fixed: getOrderedSummaryInformation ignores explicit 
fromDate and thruDate (OFBIZ-13664)
2c17552d6b is described below

commit 2c17552d6bd675bfaa165c20aec86ad1c857d9f8
Author: Mridul Pathak <[email protected]>
AuthorDate: Fri Oct 9 12:25:54 2026 +0530

    Fixed: getOrderedSummaryInformation ignores explicit fromDate and thruDate 
(OFBIZ-13664)
    
    The service declares fromDate and thruDate as IN attributes and the 
mini-lang used them to restrict the orders, letting monthsToInclude override 
them. The Groovy conversion initialised both to null and only set them from 
monthsToInclude, so callers passing only dates received the totals of all 
orders. Seed fromDate and thruDate from the parameters again, and keep 
monthsToInclude overriding them.
    
    On release24.09 the optional monthsToInclude, roleTypeId, orderTypeId and 
statusId were also read as undeclared script variables, which made the service 
throw whenever a caller omitted one of them. Read them from the parameters, as 
trunk does.
    
    (cherry picked from commit d7dd0157e146efe2d103c244752b0b8f4f7196d4)
---
 .../org/apache/ofbiz/order/order/OrderServicesScript.groovy    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 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 41764950d6..54b0ffa552 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
@@ -87,16 +87,18 @@ Map getOrderedSummaryInformation() {
         return result
     }
     */
-    Timestamp fromDate = null, thruDate = null
+    Timestamp fromDate = parameters.fromDate
+    Timestamp thruDate = parameters.thruDate
     Timestamp now = UtilDateTime.nowTimestamp()
+    Integer monthsToInclude = parameters.monthsToInclude
     if (monthsToInclude) {
         thruDate = now
         fromDate = UtilDateTime.adjustTimestamp(now, Calendar.MONTH, 
-monthsToInclude)
     }
 
-    roleTypeId = roleTypeId ?: 'PLACING_CUSTOMER'
-    orderTypeId = orderTypeId ?: 'SALES_ORDER'
-    statusId = statusId ?: 'ORDER_COMPLETED'
+    String roleTypeId = parameters.roleTypeId ?: 'PLACING_CUSTOMER'
+    String orderTypeId = parameters.orderTypeId ?: 'SALES_ORDER'
+    String statusId = parameters.statusId ?: 'ORDER_COMPLETED'
 
     //find the existing exchange rates
     exprBldr = new EntityConditionBuilder()

Reply via email to