[freeside-commits] branch master updated. a5a541f3b1db3192f7d4a7dd5ad1fbf5800ef586

Ivan ivan at 420.am
Wed Nov 16 17:10:19 PST 2016


The branch, master has been updated
       via  a5a541f3b1db3192f7d4a7dd5ad1fbf5800ef586 (commit)
       via  4090933e1de8cae6ed89794a5bbacf3b3ed434d5 (commit)
       via  c67eaf049134e6f7ab9fe8d33d043d7d397008f3 (commit)
      from  2dff574c971b18e3b3c74653e7e1376b7b57c3bb (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 a5a541f3b1db3192f7d4a7dd5ad1fbf5800ef586
Merge: 4090933 2dff574
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Nov 16 17:10:12 2016 -0800

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit 4090933e1de8cae6ed89794a5bbacf3b3ed434d5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Nov 16 17:10:07 2016 -0800

    oops, necessary for recent UI work

diff --git a/httemplate/elements/popup-topreload.html b/httemplate/elements/popup-topreload.html
new file mode 100644
index 0000000..00d5cdf
--- /dev/null
+++ b/httemplate/elements/popup-topreload.html
@@ -0,0 +1,21 @@
+<%doc>
+
+Example:
+
+  <& /elements/popup-topreload, mt('Action completed') &>
+
+</%doc>
+<& /elements/header-popup.html, encode_entities($message) &>
+  <script src="<% $fsurl %>elements/js.cookie.js"></script>
+  <SCRIPT TYPE="text/javascript">
+    Cookies.set('freeside_status', <% $message |js_string %>,{
+                  expires: 0.0035
+    });
+    topreload();
+  </SCRIPT>
+<& /elements/footer-popup.html &>
+<%init>
+
+my $message = shift;
+
+</%init>

commit c67eaf049134e6f7ab9fe8d33d043d7d397008f3
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Nov 16 17:08:18 2016 -0800

    when searching locaitons, don't search historic locations by default, RT#73412

diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index e021140..14dd4b4 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -695,6 +695,21 @@ sub search {
     push @where, FS::cust_main->$method();
   }
 
+  my $current = '';
+  unless ( $params->{location_history} ) {
+    $current = '
+      AND (    cust_location.locationnum IN ( cust_main.bill_locationnum,
+                                              cust_main.ship_locationnum
+                                            )
+            OR cust_location.locationnum IN (
+                 SELECT locationnum FROM cust_pkg
+                  WHERE cust_pkg.custnum = cust_main.custnum
+                    AND locationnum IS NOT NULL
+                    AND '. FS::cust_pkg->ncancelled_recurring_sql.'
+               )
+          )';
+  }
+
   ##
   # address
   ##
@@ -714,6 +729,7 @@ sub search {
         SELECT 1 FROM cust_location 
         WHERE cust_location.custnum = cust_main.custnum
           AND (".join(' OR ', at orwhere).")
+          $current
         )";
     }
   }
@@ -727,6 +743,7 @@ sub search {
       SELECT 1 FROM cust_location
       WHERE cust_location.custnum = cust_main.custnum
         AND cust_location.city = $city
+        $current
     )";
   }
 
@@ -739,6 +756,7 @@ sub search {
       SELECT 1 FROM cust_location
       WHERE cust_location.custnum = cust_main.custnum
         AND cust_location.county = $county
+        $current
     )";
   }
 
@@ -751,6 +769,7 @@ sub search {
       SELECT 1 FROM cust_location
       WHERE cust_location.custnum = cust_main.custnum
         AND cust_location.state = $state
+        $current
     )";
   }
 
@@ -763,6 +782,7 @@ sub search {
       SELECT 1 FROM cust_location
       WHERE cust_location.custnum = cust_main.custnum
         AND cust_location.zip LIKE $zip
+        $current
     )";
   }
 
@@ -775,6 +795,7 @@ sub search {
       SELECT 1 FROM cust_location
       WHERE cust_location.custnum = cust_main.custnum
         AND cust_location.country = '$country'
+        $current
     )";
   }
 
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 714d292..4e9ede3 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -5072,6 +5072,17 @@ sub cancel_sql {
   "cust_pkg.cancel IS NOT NULL AND cust_pkg.cancel != 0";
 }
 
+=item ncancelled_recurring_sql
+
+Returns an SQL expression identifying un-cancelled, recurring packages.
+
+=cut
+
+sub ncancelled_recurring_sql {
+  $_[0]->recurring_sql().
+  " AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 ) ";
+}
+
 =item status_sql
 
 Returns an SQL expression to give the package status as a string.
diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html
index 672c201..1aa3390 100755
--- a/httemplate/search/cust_main.html
+++ b/httemplate/search/cust_main.html
@@ -41,7 +41,8 @@ my %search_hash = ();
 
 #scalars
 my @scalars = qw (
-  agentnum salesnum status address city county state zip country
+  agentnum salesnum status
+  address city county state zip country location_history
   invoice_terms
   no_censustract with_geocode with_email tax no_tax POST no_POST
   custbatch usernum
diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html
index b6be023..69bbe85 100755
--- a/httemplate/search/report_cust_main.html
+++ b/httemplate/search/report_cust_main.html
@@ -197,6 +197,10 @@
       </TD>
     </TR>
 
+    <TR>
+      <TH ALIGN="right" VALIGN="center"><% mt('Search historical addresses') %></TH>
+      <TD><INPUT TYPE="checkbox" NAME="location_history" VALUE="1"></TD>
+
   </TABLE>
   <BR>
 

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

Summary of changes:
 FS/FS/cust_main/Search.pm                |   21 +++++++++++++++++++++
 FS/FS/cust_pkg.pm                        |   11 +++++++++++
 httemplate/elements/popup-topreload.html |   21 +++++++++++++++++++++
 httemplate/search/cust_main.html         |    3 ++-
 httemplate/search/report_cust_main.html  |    4 ++++
 5 files changed, 59 insertions(+), 1 deletion(-)
 create mode 100644 httemplate/elements/popup-topreload.html




More information about the freeside-commits mailing list