[freeside-commits] branch FREESIDE_4_BRANCH updated. f0beed098a1b03f5e7d7e00624053019f635f158

Ivan ivan at 420.am
Wed Sep 23 10:51:32 PDT 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  f0beed098a1b03f5e7d7e00624053019f635f158 (commit)
      from  a8eef07a8b1086f0249297f6e99c241105e5538f (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 f0beed098a1b03f5e7d7e00624053019f635f158
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Sep 23 10:51:30 2015 -0700

    fix searches for cust_pay events, RT#35167

diff --git a/FS/FS/cust_event.pm b/FS/FS/cust_event.pm
index c35e118..1d8af1e 100644
--- a/FS/FS/cust_event.pm
+++ b/FS/FS/cust_event.pm
@@ -9,6 +9,7 @@ use FS::Record qw( qsearch qsearchs dbdef );
 use FS::cust_main;
 use FS::cust_pkg;
 use FS::cust_bill;
+use FS::cust_pay;
 use FS::svc_acct;
 
 $DEBUG = 0;
@@ -305,11 +306,13 @@ sub join_sql {
   LEFT JOIN cust_pay  ON ( eventtable = 'cust_pay'  AND tablenum = paynum  )
   LEFT JOIN cust_svc  ON ( eventtable = 'svc_acct'  AND tablenum = svcnum  )
   LEFT JOIN cust_pkg AS cust_pkg_for_svc ON ( cust_svc.pkgnum = cust_pkg_for_svc.pkgnum )
-  LEFT JOIN cust_main ON (    ( eventtable = 'cust_main' AND tablenum = cust_main.custnum )
-                           OR ( eventtable = 'cust_bill' AND cust_bill.custnum = cust_main.custnum )
-                           OR ( eventtable = 'cust_pkg'  AND cust_pkg.custnum  = cust_main.custnum )
-                           OR ( eventtable = 'svc_acct'  AND cust_pkg_for_svc.custnum  = cust_main.custnum )
-                         )
+  LEFT JOIN cust_main ON (
+       ( eventtable = 'cust_main' AND tablenum = cust_main.custnum )
+    OR ( eventtable = 'cust_bill' AND cust_bill.custnum = cust_main.custnum )
+    OR ( eventtable = 'cust_pkg'  AND cust_pkg.custnum  = cust_main.custnum )
+    OR ( eventtable = 'cust_pay'  AND cust_pay.custnum  = cust_main.custnum )
+    OR ( eventtable = 'svc_acct'  AND cust_pkg_for_svc.custnum  = cust_main.custnum )
+  )
   ";
 
 }
@@ -389,6 +392,11 @@ sub search_sql_where {
                   "tablenum = '$1'";
   }
 
+  if ( $param->{'paynum'} =~ /^(\d+)$/ ) {
+    push @search, "part_event.eventtable = 'cust_pay'",
+                  "tablenum = '$1'";
+  }
+
   if ( $param->{'svcnum'} =~ /^(\d+)$/ ) {
     push @search, "part_event.eventtable = 'svc_acct'",
                   "tablenum = '$1'";

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

Summary of changes:
 FS/FS/cust_event.pm |   18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list