X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Fcancel_pkg.html;h=a4371e6f3a5aa777540b9616b6c0b2c707154496;hb=49630d793f7901da93a4ffc298f5f328d8a12705;hp=d265c184999219d9031e1a8166cbf41258df3115;hpb=f49f11d4c3c4ba9480cc5c9acfaa606a5ba73ad1;p=freeside.git diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html index d265c1849..a4371e6f3 100755 --- a/httemplate/misc/process/cancel_pkg.html +++ b/httemplate/misc/process/cancel_pkg.html @@ -1,4 +1,4 @@ -<% header("Package $past{$method}") %> +<% header(emt("Package $past{$method}")) %> @@ -44,16 +44,13 @@ my $date = time; if ($method eq 'expire' || $method eq 'adjourn'){ #untaint date $date = $cgi->param('date'); - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; + parse_datetime($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; $date = $1; + $method = ($method eq 'expire') ? 'cancel' : 'suspend'; } my $cust_pkg = qsearchs( 'cust_pkg', {'pkgnum'=>$pkgnum} ); -#my $otaker = $FS::CurrentUser::CurrentUser->name; -#$otaker = $FS::CurrentUser::CurrentUser->username -# if ($otaker eq "User, Legacy"); - if ($reasonnum == -1) { $reasonnum = { 'typenum' => scalar( $cgi->param('newreasonnumT') ), @@ -61,15 +58,7 @@ if ($reasonnum == -1) { }; } -my $error; -if ($method eq 'expire' || $method eq 'adjourn'){ - my %hash = $cust_pkg->hash; - $hash{$method} = $date; - my $new = new FS::cust_pkg \%hash; - $error = $new->replace($cust_pkg, 'reason' => $reasonnum); -} else { - $error = $cust_pkg->$method( 'reason' => $reasonnum ); -} +my $error = $cust_pkg->$method( 'reason' => $reasonnum, 'date' => $date ); if ($error) { $cgi->param('error', $error);