X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fexpire_pkg.cgi;h=b59674a69603673b9c34d89d3cbae6b278afa689;hp=21e220d1800f76da585f9e0427bc471bc5a5cc1b;hb=d8ff6db2dbaec9cc8daad2d4af0254f167aa7a66;hpb=3d671921441ba8422650b54435a1959ad1d4c71d diff --git a/httemplate/misc/expire_pkg.cgi b/httemplate/misc/expire_pkg.cgi index 21e220d18..b59674a69 100755 --- a/httemplate/misc/expire_pkg.cgi +++ b/httemplate/misc/expire_pkg.cgi @@ -1,38 +1,55 @@ + <% -# - -use strict; -use vars qw ( $cgi $date $pkgnum $cust_pkg %hash $new $error ); -use Date::Parse; -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl eidiot); -use FS::Record qw(qsearchs); -use FS::cust_pkg; - -$cgi = new CGI; -&cgisuidsetup($cgi); - -#untaint date & pkgnum - -if ( $cgi->param('date') ) { - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date=$1; -} else { - $date=''; -} - -$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; -$pkgnum = $1; - -$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -%hash = $cust_pkg->hash; -$hash{expire}=$date; -$new = new FS::cust_pkg ( \%hash ); -$error = $new->replace($cust_pkg); -&eidiot($error) if $error; - -print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); + +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/; +my $pkgnum = $1; + +#get package record +my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +die "Unknown pkgnum $pkgnum" unless $cust_pkg; +my $part_pkg = $cust_pkg->part_pkg; + +my $custnum = $cust_pkg->getfield('custnum'); + +my $date = $cust_pkg->expire ? time2str('%D', $cust_pkg->expire) : ''; %> + +<%= header('Expire package', menubar( + "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + 'Main Menu' => popurl(2) +)) %> + + + + + + +<%= $pkgnum %>: <%= $part_pkg->pkg. ' - '. $part_pkg->comment %> + +
+ + + + + + +
Cancel package on + +
m/d/y +
+ + + + +
+ +