X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Fcancel_pkg.html;h=e17872c066e03fd61eee1883d694e7ac564755e2;hb=eaaf5c590f2039076585d5f3ca2551fad048b5ba;hp=d265c184999219d9031e1a8166cbf41258df3115;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/httemplate/misc/process/cancel_pkg.html b/httemplate/misc/process/cancel_pkg.html index d265c1849..e17872c06 100755 --- a/httemplate/misc/process/cancel_pkg.html +++ b/httemplate/misc/process/cancel_pkg.html @@ -44,8 +44,9 @@ 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} ); @@ -61,15 +62,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);