[freeside-commits] branch master updated. 6b36f36dbf2cc6ae381827db1f1cdff394a3d334

Mark Wells mark at 420.am
Fri Apr 5 16:16:18 PDT 2013


The branch, master has been updated
       via  6b36f36dbf2cc6ae381827db1f1cdff394a3d334 (commit)
       via  fd67c768f2f59f7883197889ef02bb3e1fb2b0c7 (commit)
       via  ce27e05645c490fb75c21395b4f6f79d8f4e81e7 (commit)
      from  4645160bf2a76932461f06cfaf472de006ab414b (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 6b36f36dbf2cc6ae381827db1f1cdff394a3d334
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Apr 5 16:15:56 2013 -0700

    tolerate custnum errors in quick payment entry, #22369

diff --git a/httemplate/misc/batch-cust_pay.html b/httemplate/misc/batch-cust_pay.html
index ef06441..0b2f1f1 100644
--- a/httemplate/misc/batch-cust_pay.html
+++ b/httemplate/misc/batch-cust_pay.html
@@ -23,10 +23,12 @@ function add_row_callback(rownum, prefix) {
 
 function custnum_update_callback(rownum, prefix) {
   var custnum = document.getElementById('custnum'+rownum).value;
-  document.getElementById('enable_app'+rownum).disabled = (
-    custnum == 0 || 
-    num_open_invoices[rownum] < 2
-  );
+  // if there is a custnum and more than one open invoice, enable
+  // (and check) the box
+  var show_applications = (custnum > 0 && num_open_invoices[rownum] > 1);
+  var enable_app_checkbox = document.getElementById('enable_app'+rownum);
+  enable_app_checkbox.disabled = show_applications;
+
 % if ( $use_discounts ) {
   select_discount_term(rownum, prefix);
 % }
@@ -34,9 +36,6 @@ function custnum_update_callback(rownum, prefix) {
 
 function invnum_update_callback(rownum, prefix) {
   custnum_update_callback(rownum, prefix);
-  var enable = document.getElementById('enable_app'+rownum);
-  enable.checked = true;
-  toggle_application_row.call(enable);
 }
 
 function select_discount_term(row, prefix) {
@@ -96,6 +95,17 @@ function toggle_application_row(ev, next) {
         next.call(this, rownum);
       }
     );
+  } else {
+    var row = document.getElementById('row'+rownum);
+    var table_rows = row.parentNode.rows;
+    for (i = row.sectionRowIndex; i < table_rows.count; i++) {
+      if ( table_rows[i].id.indexof('row'+rownum+'.') > -1 ) {
+        table_rows.removeChild(table_rows[i]);
+      } else {
+        break;
+      }
+    }
+    lock_payment_row(rownum, false);
   }
 }
 
diff --git a/httemplate/misc/xmlhttp-cust_bill-search.html b/httemplate/misc/xmlhttp-cust_bill-search.html
index 46f15d1..459c5db 100644
--- a/httemplate/misc/xmlhttp-cust_bill-search.html
+++ b/httemplate/misc/xmlhttp-cust_bill-search.html
@@ -6,13 +6,15 @@ die 'access denied' unless $curuser->access_right('View invoices');
 my @return;
 if ( $cgi->param('sub') eq 'custnum_search_open' ) { 
   my $custnum = $cgi->param('arg');
-  #warn "searching invoices for $custnum\n";
-  my $cust_main = FS::cust_main->by_key($custnum);
-  @return = map { 
-    +{ $_->hash, 
-      'owed' => $_->owed }
-  } $cust_main->open_cust_bill
-    if $curuser->agentnums_href->{ $cust_main->agentnum };
+  if ( $custnum =~ /^(\d+)$/ ) {
+#warn "searching invoices for $custnum\n";
+    my $cust_main = FS::cust_main->by_key($custnum);
+    @return = map { 
+      +{ $_->hash, 
+        'owed' => $_->owed }
+    } $cust_main->open_cust_bill
+      if $curuser->agentnums_href->{ $cust_main->agentnum };
+  }
 }
 
 </%init>

commit fd67c768f2f59f7883197889ef02bb3e1fb2b0c7
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Apr 5 12:13:45 2013 -0700

    speed up service search

diff --git a/FS/FS/svc_hardware.pm b/FS/FS/svc_hardware.pm
index 96502e4..b28cc9e 100644
--- a/FS/FS/svc_hardware.pm
+++ b/FS/FS/svc_hardware.pm
@@ -105,9 +105,13 @@ sub search_sql {
   my ($class, $string) = @_;
   my @where = ();
 
-  my $ip = NetAddr::IP->new($string);
-  if ( $ip ) {
-    push @where, $class->search_sql_field('ip_addr', $ip->addr);
+  if ( $string =~ /^[\d\.:]+$/ ) {
+    # if the string isn't an IP address, this will waste several seconds
+    # attempting a DNS lookup.  so try to filter those out.
+    my $ip = NetAddr::IP->new($string);
+    if ( $ip ) {
+      push @where, $class->search_sql_field('ip_addr', $ip->addr);
+    }
   }
   
   if ( $string =~ /^(\w+)$/ ) {

commit ce27e05645c490fb75c21395b4f6f79d8f4e81e7
Author: Mark Wells <mark at freeside.biz>
Date:   Fri Apr 5 12:13:23 2013 -0700

    less verbose default field labels

diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
index 01495ca..7c396ec 100755
--- a/FS/FS/svc_broadband.pm
+++ b/FS/FS/svc_broadband.pm
@@ -103,10 +103,10 @@ sub table_info {
     'ip_field' => 'ip_addr',
     'fields' => {
       'svcnum'      => 'Service',
-      'description' => 'Descriptive label for this particular device',
-      'speed_down'  => 'Maximum download speed for this service in Kbps.  0 denotes unlimited.',
-      'speed_up'    => 'Maximum upload speed for this service in Kbps.  0 denotes unlimited.',
-      'ip_addr'     => 'IP address.  Leave blank for automatic assignment.',
+      'description' => 'Descriptive label',
+      'speed_down'  => 'Download speed (Kbps)',
+      'speed_up'    => 'Upload speed (Kbps)',
+      'ip_addr'     => 'IP address',
       'blocknum'    => 
       { 'label' => 'Address block',
                          'type'  => 'select',

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

Summary of changes:
 FS/FS/svc_broadband.pm                        |    8 ++++----
 FS/FS/svc_hardware.pm                         |   10 +++++++---
 httemplate/misc/batch-cust_pay.html           |   24 +++++++++++++++++-------
 httemplate/misc/xmlhttp-cust_bill-search.html |   16 +++++++++-------
 4 files changed, 37 insertions(+), 21 deletions(-)




More information about the freeside-commits mailing list