[freeside-commits] branch FREESIDE_4_BRANCH updated. 4915d6e8fd9dbc933049da8051e2fcfb66da0f8c

Mark Wells mark at 420.am
Fri Jul 17 16:57:04 PDT 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  4915d6e8fd9dbc933049da8051e2fcfb66da0f8c (commit)
       via  c03de6a138b3dda3086240fe6589c9e5be721d83 (commit)
      from  86c56cd13164f5ae77d89ced20042b6db35bee23 (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 4915d6e8fd9dbc933049da8051e2fcfb66da0f8c
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jul 17 15:20:37 2015 -0700

    also fix searching by charged/owed amount

diff --git a/FS/FS/cust_bill/Search.pm b/FS/FS/cust_bill/Search.pm
index 925938d..ee5da3b 100644
--- a/FS/FS/cust_bill/Search.pm
+++ b/FS/FS/cust_bill/Search.pm
@@ -276,7 +276,7 @@ sub search_sql_where {
     my @owed = ref($param->{owed})
                  ? @{ $param->{owed} }
                  : ($param->{owed});
-    push @search, map { s/^owed/$owed_sql/ } @owed;
+    push @search, map { s/^owed/$owed_sql/; $_ } @owed;
   }
 
   #open/net flags

commit c03de6a138b3dda3086240fe6589c9e5be721d83
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Jul 17 15:08:57 2015 -0700

    fix invoice reprinting + cust_bill::Search changes, #37320, from #25943

diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 5052ed1..6a4fa1e 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -2974,6 +2974,9 @@ sub process_re_X {
 
 }
 
+# this is called from search/cust_bill.html and given all its search 
+# parameters, so it needs to perform the same search.
+
 sub re_X {
   # spool_invoice ftp_invoice fax_invoice print_invoice
   my($method, $job, %param ) = @_;
@@ -2983,22 +2986,15 @@ sub re_X {
   }
 
   #some false laziness w/search/cust_bill.html
-  my $distinct = '';
-  my $orderby = 'ORDER BY cust_bill._date';
-
-  my $extra_sql = ' WHERE '. FS::cust_bill->search_sql_where(\%param);
-
-  my $addl_from = 'LEFT JOIN cust_main USING ( custnum )';
-     
-  my @cust_bill = qsearch( {
-    #'select'    => "cust_bill.*",
-    'table'     => 'cust_bill',
-    'addl_from' => $addl_from,
-    'hashref'   => {},
-    'extra_sql' => $extra_sql,
-    'order_by'  => $orderby,
-    'debug' => 1,
-  } );
+  $param{'order_by'} = 'cust_bill._date';
+
+  my $query = FS::cust_bill->search(\%param);
+  delete $query->{'count_query'};
+  delete $query->{'count_addl'};
+
+  $query->{debug} = 1; # was in here before, is obviously useful  
+
+  my @cust_bill = qsearch( $query );
 
   $method .= '_invoice' unless $method eq 'email' || $method eq 'print';
 

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

Summary of changes:
 FS/FS/cust_bill.pm        |   28 ++++++++++++----------------
 FS/FS/cust_bill/Search.pm |    2 +-
 2 files changed, 13 insertions(+), 17 deletions(-)




More information about the freeside-commits mailing list