X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Fprocess%2Fcancel_pkg.html;h=e17872c066e03fd61eee1883d694e7ac564755e2;hb=9f351b4a4df08d607aa0d647709b06cbea1c5ffe;hp=d265c184999219d9031e1a8166cbf41258df3115;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;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);