remove everything that links to package view also, closes: Bug#569
[freeside.git] / httemplate / edit / process / REAL_cust_pkg.cgi
1 <%
2
3 my $pkgnum = $cgi->param('pkgnum') or die;
4 my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
5 my %hash = $old->hash;
6 $hash{'setup'} = $cgi->param('setup') ? str2time($cgi->param('setup')) : '';
7 $hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : '';
8 $hash{'last_bill'} =
9   $cgi->param('last_bill') ? str2time($cgi->param('last_bill')) : '';
10 $hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : '';
11 my $new = new FS::cust_pkg \%hash;
12
13 my $error = $new->replace($old);
14
15 if ( $error ) {
16   $cgi->param('error', $error);
17   print $cgi->redirect(popurl(2). "REAL_cust_pkg.cgi?". $cgi->query_string );
18 } else { 
19   my $custnum = $new->custnum;
20   print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum".
21                        "#cust_pkg$pkgnum" );
22 }
23
24 %>