[freeside-commits] branch master updated. b64599c894116623746b90d184ba708d67392c65

Ivan ivan at 420.am
Sun Mar 29 18:18:36 PDT 2015


The branch, master has been updated
       via  b64599c894116623746b90d184ba708d67392c65 (commit)
       via  d9896763f3a2352ff907ff5eb12185b264fd504e (commit)
      from  e0d62e76fe19b44c348b43d4e4fb5aba26647a4a (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 b64599c894116623746b90d184ba708d67392c65
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Mar 29 18:18:26 2015 -0700

    add quantity to self-service change_pkg, RT#34068

diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 2671afb..471a093 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -2432,26 +2432,26 @@ sub change_pkg {
   return { error=>"Can't change a suspended package", pkgnum=>$cust_pkg->pkgnum}
     if $cust_pkg->status eq 'suspended';
 
-  my @newpkg;
-  my $error = FS::cust_pkg::order( $custnum,
-                                   [$p->{pkgpart}],
-                                   [$p->{pkgnum}],
-                                   \@newpkg,
-                                 );
+  my $err_or_cust_pkg = $cust_pkg->change( 'pkgpart'  => $p->{'pkgpart'},
+                                           'quantity' => $p->{'quantity'} || 1,
+                                         );
+
+  return { error=>$err_or_cust_pkg, pkgnum=>$cust_pkg->pkgnum }
+    unless ref($err_or_cust_pkg);
 
   if ( $conf->exists('signup_server-realtime') ) {
 
     my $bill_error = _do_bop_realtime( $cust_main, $status, 'no_credit'=>1 );
 
     if ($bill_error) {
-      $newpkg[0]->suspend;
+      $err_or_cust_pkg->suspend;
       return $bill_error;
     } else {
-      $newpkg[0]->reexport;
+      $err_or_cust_pkg->reexport;
     }
 
   } else {  
-    $newpkg[0]->reexport;
+    $err_or_cust_pkg->reexport;
   }
 
   return { error => '', pkgnum => $cust_pkg->pkgnum };
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index bafbb58..0a1d002 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -106,6 +106,8 @@ FS::cust_pkg - Object methods for cust_pkg objects
 
   $seconds = $record->seconds_since($timestamp);
 
+  #bulk cancel+order... perhaps slightly deprecated, only used by the bulk
+  # cancel+order in the web UI and nowhere else (edit/process/cust_pkg.cgi)
   $error = FS::cust_pkg::order( $custnum, \@pkgparts );
   $error = FS::cust_pkg::order( $custnum, \@pkgparts, \@remove_pkgnums ] );
 
@@ -4687,6 +4689,9 @@ sub _X_show_zero {
 
 =item order CUSTNUM, PKGPARTS_ARYREF, [ REMOVE_PKGNUMS_ARYREF [ RETURN_CUST_PKG_ARRAYREF [ REFNUM ] ] ]
 
+Bulk cancel + order subroutine.  Perhaps slightly deprecated, only used by the
+bulk cancel+order in the web UI and nowhere else (edit/process/cust_pkg.cgi)
+
 CUSTNUM is a customer (see L<FS::cust_main>)
 
 PKGPARTS is a list of pkgparts specifying the the billing item definitions (see
diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm
index ff05c84..12ffbb0 100644
--- a/fs_selfservice/FS-SelfService/SelfService.pm
+++ b/fs_selfservice/FS-SelfService/SelfService.pm
@@ -1028,6 +1028,10 @@ Existing customer package.
 
 New package to order (see L<FS::part_pkg>).
 
+=item quantity
+
+Quantity for this package order (default 1).
+
 =back
 
 Returns a hash reference with the following keys:

commit d9896763f3a2352ff907ff5eb12185b264fd504e
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sun Mar 29 18:02:43 2015 -0700

    deb 8 apache DocumentRoot has changed

diff --git a/Makefile b/Makefile
index 67bf83c..99e3dbc 100644
--- a/Makefile
+++ b/Makefile
@@ -31,8 +31,10 @@ DIST_CONF = ${FREESIDE_CONF}/default_conf
 #Apache 2.4 (Debian 8.x)
 APACHE_VERSION=2.4
 
-#deb
+#deb (-7 and upgrades)
 FREESIDE_DOCUMENT_ROOT = /var/www/freeside
+#deb (new installs of 8+)
+#FREESIDE_DOCUMENT_ROOT = /var/www/html/freeside
 #redhat, fedora, mandrake
 #FREESIDE_DOCUMENT_ROOT = /var/www/html/freeside
 #freebsd

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

Summary of changes:
 FS/FS/ClientAPI/MyAccount.pm                 |   18 +++++++++---------
 FS/FS/cust_pkg.pm                            |    5 +++++
 Makefile                                     |    4 +++-
 fs_selfservice/FS-SelfService/SelfService.pm |    4 ++++
 4 files changed, 21 insertions(+), 10 deletions(-)




More information about the freeside-commits mailing list