[freeside-commits] branch master updated. 67622d2fde244b52fdca6a4ba4b98e2453f7986a

Mark Wells mark at 420.am
Wed Sep 10 12:52:19 PDT 2014


The branch, master has been updated
       via  67622d2fde244b52fdca6a4ba4b98e2453f7986a (commit)
       via  fc45339e2dd9954ed2e1ef5907592660d68892b2 (commit)
      from  6912944a9959e4046b095fbd378f5545c2caca9e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 67622d2fde244b52fdca6a4ba4b98e2453f7986a
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Sep 10 12:52:14 2014 -0700

    unbreak cust_main search, fallout from cust_payby work, #23741

diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 0c00477..bb5891d 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -477,11 +477,12 @@ sub smart_search {
 
     push @cust_main, qsearch({
       'table'     => 'cust_main',
+      'addl_from' => ' JOIN cust_payby USING (custnum)',
       'hashref'   => {},
-      'extra_sql' => " WHERE (    payinfo LIKE '$like_search'
-                               OR paymask =    '$mask_search'
+      'extra_sql' => " WHERE (    cust_payby.payinfo LIKE '$like_search'
+                               OR cust_payby.paymask =    '$mask_search'
                              ) ".
-                     " AND payby IN ('CARD','DCRD') ".
+                     " AND cust_payby.payby IN ('CARD','DCRD') ".
                      " AND $agentnums_sql", #agent virtulization
     });
 
@@ -896,10 +897,10 @@ sub search {
                   :  ( $params->{'payby'} );
 
     @payby = grep /^([A-Z]{4})$/, @payby;
-
-    push @where, '( '. join(' OR ', map "cust_main.payby = '$_'", @payby). ' )'
+    my $in_payby = 'IN(' . join(',', map {"'$_'"} @payby) . ')';
+    push @where, "EXISTS( SELECT 1 FROM cust_payby WHERE payby $in_payby ".
+                 "AND cust_payby.custnum = cust_main.custnum)"
       if @payby;
-
   }
 
   ###

commit fc45339e2dd9954ed2e1ef5907592660d68892b2
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Sep 9 22:34:28 2014 -0700

    debugging aid

diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html
index 8f62720..e6309ea 100644
--- a/httemplate/search/elements/search.html
+++ b/httemplate/search/elements/search.html
@@ -432,7 +432,7 @@ if ( ref($opt{query}) ) {
   }
 
   #eval "use FS::$opt{'query'};";
-  my @param = qw( select table addl_from hashref extra_sql order_by );
+  my @param = qw( select table addl_from hashref extra_sql order_by debug );
   $rows = [ qsearch( [ map { my $query = $_;
                              ({ map { $_ => $query->{$_} } @param });
                            }

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_main/Search.pm              |   13 +++++++------
 httemplate/search/elements/search.html |    2 +-
 2 files changed, 8 insertions(+), 7 deletions(-)




More information about the freeside-commits mailing list