From b184cc2b83eea6b02445ca7a24446c96a70636f6 Mon Sep 17 00:00:00 2001
From: Thomas Heck <theck@linet-services.de>
Date: Mon, 19 Nov 2012 11:26:50 +0100
Subject: [PATCH] =?utf8?q?Bei=20numerischen=20CVars=20die=20Filteroptionen?=
 =?utf8?q?=20mit=20=C3=BCbergeben.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

fixt #1864
---
 bin/mozilla/ct.pl       |  1 +
 bin/mozilla/ic.pl       | 10 ++++++++--
 bin/mozilla/projects.pl |  7 ++++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl
index a81f451a6..d7cebc4dc 100644
--- a/bin/mozilla/ct.pl
+++ b/bin/mozilla/ct.pl
@@ -209,6 +209,7 @@ sub list_names {
       addr_city business_id
     ), "$form->{db}number",
     map({ "cvar_$_->{name}" } @searchable_custom_variables),
+    map({'cvar_'. $_->{name} .'_qtyop'} grep({$_->{type} eq 'number'} @searchable_custom_variables)),
     map({ "l_$_" } @columns),
   );
 
diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl
index 5b3e66563..f01b5afcb 100644
--- a/bin/mozilla/ic.pl
+++ b/bin/mozilla/ic.pl
@@ -1238,8 +1238,14 @@ sub generate_report {
   map { $column_defs{$_}->{visible} ||= $form->{"l_$_"} ? 1 : 0 } @columns;
   map { $column_defs{$_}->{align}   = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal), @pricegroup_columns;
 
-  my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups), @itemstatus_keys, @callback_keys,
-                              map({ "cvar_$_->{name}" } @searchable_custom_variables), map { "l_$_" } @columns);
+  my @hidden_variables = (
+    qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups),
+    @itemstatus_keys,
+    @callback_keys,
+    map({ "cvar_$_->{name}" } @searchable_custom_variables),
+    map({'cvar_'. $_->{name} .'_qtyop'} grep({$_->{type} eq 'number'} @searchable_custom_variables)),
+    map({ "l_$_" } @columns),
+  );
 
   my $callback         = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables);
 
diff --git a/bin/mozilla/projects.pl b/bin/mozilla/projects.pl
index b7614ffc6..bda1c6d96 100644
--- a/bin/mozilla/projects.pl
+++ b/bin/mozilla/projects.pl
@@ -121,6 +121,7 @@ sub project_report {
   my @columns      = qw(projectnumber description active);
 
   my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
+  my @searchable_custom_variables  = grep { $_->{searchable} }  @{ $cvar_configs };
   my %column_defs_cvars            = ();
   foreach (@includeable_custom_variables) {
     $column_defs_cvars{"cvar_$_->{name}"} = {
@@ -132,7 +133,11 @@ sub project_report {
   push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables;
 
 
-  my @hidden_vars  = ('filter', map { ('cvar_'. $_->{name} , 'l_cvar_'. $_->{name}) } @includeable_custom_variables);
+  my @hidden_vars  = (
+    'filter',
+    map({ ('cvar_'. $_->{name} , 'l_cvar_'. $_->{name}) } @includeable_custom_variables),
+    map({'cvar_'. $_->{name} .'_qtyop'} grep({$_->{type} eq 'number'} @searchable_custom_variables)),
+  );
   my $href         = build_std_url('action=project_report', @hidden_vars);
 
 
-- 
2.20.1