3 my $pkgnum = $cgi->param('pkgnum') or die;
4 my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
6 $hash{'setup'} = $cgi->param('setup') ? str2time($cgi->param('setup')) : '';
7 $hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : '';
9 $cgi->param('last_bill') ? str2time($cgi->param('last_bill')) : '';
10 $hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : '';
14 if ( $hash{'bill'} != $old->bill # if the next bill date was changed
15 && $hash{'bill'} < time # to a date in the past
16 && ! $cgi->param('bill_areyousure') # and it wasn't confirmed
19 $error = '_bill_areyousure';
21 $new = new FS::cust_pkg \%hash;
22 $error = $new->replace($old);
26 $cgi->param('error', $error);
27 print $cgi->redirect(popurl(2). "REAL_cust_pkg.cgi?". $cgi->query_string );
29 my $custnum = $new->custnum;
30 print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum".