[freeside-commits] branch FREESIDE_3_BRANCH updated. 1f4450a6ca5746c8ac2bb7b95f42db66e277f77b

Ivan ivan at 420.am
Wed Nov 13 17:41:46 PST 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  1f4450a6ca5746c8ac2bb7b95f42db66e277f77b (commit)
      from  5cedbad0760a0a14ee38bcc8031d8185f1113b9b (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 1f4450a6ca5746c8ac2bb7b95f42db66e277f77b
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Nov 13 17:41:44 2013 -0800

    email addresses on detach customer, RT#25954, RT#22185

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 75102ce..025da48 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1860,7 +1860,7 @@ sub change {
   if ( $opt->{cust_main} ) {
     my $cust_main = $opt->{cust_main};
     unless ( $cust_main->custnum ) { 
-      my $error = $cust_main->insert;
+      my $error = $cust_main->insert( @{ $opt->{cust_main_insert_args}||[] } );
       if ( $error ) {
         $dbh->rollback if $oldAutoCommit;
         return "inserting cust_main (transaction rolled back): $error";
diff --git a/httemplate/edit/process/detach-cust_pkg.html b/httemplate/edit/process/detach-cust_pkg.html
index ab87eb5..782ffa5 100644
--- a/httemplate/edit/process/detach-cust_pkg.html
+++ b/httemplate/edit/process/detach-cust_pkg.html
@@ -30,16 +30,23 @@ my $cust_location = new FS::cust_location {
   map { $_ => scalar($cgi->param($_)) } FS::cust_main->location_fields
 };
 
+#false laziness w/process/cust_main.cgi
+my @invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') );
+push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST');
+push @invoicing_list, 'FAX' if $cgi->param('invoicing_list_FAX');
+$cgi->param('invoicing_list', join(',', @invoicing_list) );
+
 my $cust_main = new FS::cust_main {
   ( map { ( $_, scalar($cgi->param($_)) ) } fields('cust_main') ),
   ( map { ( "ship_$_", '' ) } FS::cust_main->location_fields ),
-  'bill_location' => $cust_location,
-  'ship_location' => $cust_location,
+  'bill_location'  => $cust_location,
+  'ship_location'  => $cust_location,
 };
 
 my $pkg_or_error = $cust_pkg->change( {
-  'keep_dates' => 1,
-  'cust_main'  => $cust_main,
+  'keep_dates'            => 1,
+  'cust_main'             => $cust_main,
+  'cust_main_insert_args' => [ {}, \@invoicing_list ],
 } );
 
 my $error = ref($pkg_or_error) ? '' : $pkg_or_error;

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

Summary of changes:
 FS/FS/cust_pkg.pm                            |    2 +-
 httemplate/edit/process/detach-cust_pkg.html |   15 +++++++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list