[freeside-commits] branch master updated. e5c1e2e0ca42e5857b27890307bca616ee8982aa

Mark Wells mark at 420.am
Wed Dec 19 13:54:06 PST 2012


The branch, master has been updated
       via  e5c1e2e0ca42e5857b27890307bca616ee8982aa (commit)
       via  0f701fc214468f8fb242435893de3fe084ba63f5 (commit)
      from  f197bdbaa16df592a82971c63aa4321a4788d335 (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 e5c1e2e0ca42e5857b27890307bca616ee8982aa
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Dec 19 13:53:52 2012 -0800

    ignore pkg_svc quantities when changing a customer location, #20588

diff --git a/FS/FS/cust_location.pm b/FS/FS/cust_location.pm
index 1521960..b86529b 100644
--- a/FS/FS/cust_location.pm
+++ b/FS/FS/cust_location.pm
@@ -324,6 +324,9 @@ sub move_to {
   my $dbh = dbh;
   my $error = '';
 
+  # prevent this from failing because of pkg_svc quantity limits
+  local( $FS::cust_svc::ignore_quantity ) = 1;
+
   if ( !$new->locationnum ) {
     $error = $new->insert;
     if ( $error ) {
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 75a0d77..22a7b2c 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2889,7 +2889,8 @@ sub transfer {
   }
 
   foreach my $cust_svc ($self->cust_svc) {
-    if($target{$cust_svc->svcpart} > 0) {
+    if($target{$cust_svc->svcpart} > 0
+       or $FS::cust_svc::ignore_quantity) { # maybe should be a 'force' option
       $target{$cust_svc->svcpart}--;
       my $new = new FS::cust_svc { $cust_svc->hash };
       $new->pkgnum($dest_pkgnum);

commit 0f701fc214468f8fb242435893de3fe084ba63f5
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Dec 19 12:41:57 2012 -0800

    fix JS error when pkgpart-lineage is off

diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index f3ad8f5..50aeb45 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -622,23 +622,23 @@ END
 my $warning =
   'Changing the setup or recurring fee will create a new package definition. '.
   'Continue?';
-              
+
+$javascript .= "function confirm_submit(f) {";
 if ( $conf->exists('part_pkg-lineage') ) {
   $javascript .= "
-    function confirm_submit(f) {
-    
-      var fields = Array('setup_fee','recur_fee');
-      for(var i=0; i < fields.length; i++) {
-          if ( f[fields[i]].value != f[fields[i]].defaultValue ) {
-              return confirm('$warning');
-          }
-      }
-      return true;
+
+    var fields = Array('setup_fee','recur_fee');
+    for(var i=0; i < fields.length; i++) {
+        if ( f[fields[i]].value != f[fields[i]].defaultValue ) {
+            return confirm('$warning');
+        }
     }
 ";
 }
-
-$javascript .= '</SCRIPT>';
+$javascript .= "
+  return true;
+}
+</SCRIPT>";
 
 tie my %plans, 'Tie::IxHash', %{ FS::part_pkg::plan_info() };
 

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

Summary of changes:
 FS/FS/cust_location.pm       |    3 +++
 FS/FS/cust_pkg.pm            |    3 ++-
 httemplate/edit/part_pkg.cgi |   24 ++++++++++++------------
 3 files changed, 17 insertions(+), 13 deletions(-)




More information about the freeside-commits mailing list