[freeside-commits] branch master updated. f2b43a877c70aa367595fe2fc4fcffd82f62d001

Ivan ivan at 420.am
Tue Nov 1 16:20:48 PDT 2016


The branch, master has been updated
       via  f2b43a877c70aa367595fe2fc4fcffd82f62d001 (commit)
       via  bd29d65b7ec7b2637656fbc66ae0f57fa02dcbce (commit)
       via  49cacb5122d8daacd41903d709681901501be0e5 (commit)
      from  6a4b5b3bf9b3e589cf8ff18453e9c6be6a50091a (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 f2b43a877c70aa367595fe2fc4fcffd82f62d001
Merge: bd29d65 6a4b5b3
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Nov 1 16:20:44 2016 -0700

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


commit bd29d65b7ec7b2637656fbc66ae0f57fa02dcbce
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Nov 1 16:20:40 2016 -0700

    style

diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index 81b00aa..0b6b099 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -2187,7 +2187,8 @@ sub realtime_tokenize {
                                   );
 
   my %supported_actions = $transaction->info('supported_actions');
-  return '' unless $supported_actions{'CC'} and grep(/^Tokenize$/,@{$supported_actions{'CC'}});
+  return '' unless $supported_actions{'CC'}
+                && grep /^Tokenize$/, @{$supported_actions{'CC'}};
 
   ###
   # check for banned credit card/ACH

commit 49cacb5122d8daacd41903d709681901501be0e5
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Nov 1 16:20:01 2016 -0700

    fix adding a new location on a quotation, RT#73236

diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm
index 9854c45..3f6742c 100644
--- a/FS/FS/quotation_pkg.pm
+++ b/FS/FS/quotation_pkg.pm
@@ -121,6 +121,22 @@ sub insert {
   my $oldAutoCommit = $FS::UID::AutoCommit;
   local $FS::UID::AutoCommit = 0;
 
+  #false laziness w/cust_main::Packages::order_pkg
+  if ( $options{'locationnum'} and $options{'locationnum'} != -1 ) {
+
+    $self->locationnum($options{'locationnum'});
+
+  } elsif ( $options{'cust_location'} ) {
+
+    my $error = $options{'cust_location'}->find_or_insert;
+    if ( $error ) {
+      $dbh->rollback if $oldAutoCommit;
+      return "inserting cust_location (transaction rolled back): $error";
+    }
+    $self->locationnum($options{'cust_location'}->locationnum);
+
+  }
+
   my $error = $self->SUPER::insert;
 
   if ( !$error and ($self->setup_discountnum || $self->recur_discountnum) ) {
diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi
index da5afe4..6a346e0 100644
--- a/httemplate/edit/process/quick-cust_pkg.cgi
+++ b/httemplate/edit/process/quick-cust_pkg.cgi
@@ -189,7 +189,18 @@ if ( $quotationnum ) {
   )
   : ();
 
-  #XXX handle new location
+  if ( $locationnum == -1 ) {
+    my $cust_location = FS::cust_location->new({
+      'custnum'     => $custnum,
+      'prospectnum' => $prospectnum,
+      map { $_ => scalar($cgi->param($_)) }
+        FS::cust_main->location_fields
+    });
+    $opt{'cust_location'} = $cust_location;
+  } else {
+    $opt{'locationnum'} = $locationnum;
+  }
+
   $error = $quotation_pkg->insert(%opt);
 
 } else {

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

Summary of changes:
 FS/FS/cust_main/Billing_Realtime.pm        |    3 ++-
 FS/FS/quotation_pkg.pm                     |   16 ++++++++++++++++
 httemplate/edit/process/quick-cust_pkg.cgi |   13 ++++++++++++-
 3 files changed, 30 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list