X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fdetach-cust_pkg.html;h=32820306979e5ecfff1c1d2dbe3e9b0ae65f2e6f;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hp=ab87eb536e5e09de189c011c87df4ee9a2342c2a;hpb=63973c641c4be00765fa27e55c57cc5b9aa4da19;p=freeside.git diff --git a/httemplate/edit/process/detach-cust_pkg.html b/httemplate/edit/process/detach-cust_pkg.html index ab87eb536..328203069 100644 --- a/httemplate/edit/process/detach-cust_pkg.html +++ b/httemplate/edit/process/detach-cust_pkg.html @@ -3,9 +3,9 @@ % $cgi->redirect(popurl(3). 'misc/detach_pkg.html?'. $cgi->query_string ); % } else { - <% header(emt("Package detached")) %> + <& /elements/header-popup.html, emt("Package detached") &> @@ -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;