LP#1858114: Record template filter values for aggregate columns
authorMike Rylander <mrylander@gmail.com>
Fri, 14 Aug 2020 14:35:06 +0000 (10:35 -0400)
committerJason Boyer <JBoyer@EquinoxInitiative.org>
Mon, 15 Feb 2021 21:55:20 +0000 (16:55 -0500)
Currently the "having" clause does not record template-level filter
values in the template, but forces use of a report-level parameter.
This commit allows "having" to receive a value in the same way that
"where" does.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Angela Kilsdonk <akilsdonk@equinoxinitiative.org>
Signed-off-by: Jason Boyer <JBoyer@EquinoxInitiative.org>
Open-ILS/web/js/ui/default/staff/reporter/template/app.js

index aa5ca37..07a39bf 100644 (file)
@@ -230,7 +230,11 @@ function($scope , $q , $routeParams , $location , $timeout , $window,  egCore ,
                             return !!i.transform.aggregate;
                           }).map(function (i) {
                             var cond = {};
-                            cond[i.operator.op] = '::P' + param_counter++;
+                            if (i.value === undefined) {
+                                cond[i.operator.op] = '::P' + param_counter++;
+                            }else {
+                                cond[i.operator.op] = i.value;
+                            }
                             return {
                                 alias     : i.label,
                                 path      : i.path[i.path.length - 1].classname + '-' + i.name,