X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fexpire_pkg.cgi;h=55364c6522a26f0863a6bce476c86b76ccac45d3;hp=9e4ce8b620976a6ae26796d1c2a3436f6497d71d;hb=3ce7691203a7737406bf2d4442f7fd84b81f847e;hpb=0ebeec96313dd7edfca340f01f8fbbbac1f4aa1d diff --git a/httemplate/misc/expire_pkg.cgi b/httemplate/misc/expire_pkg.cgi index 9e4ce8b62..55364c652 100755 --- a/httemplate/misc/expire_pkg.cgi +++ b/httemplate/misc/expire_pkg.cgi @@ -1,25 +1,56 @@ -<% + +% +% +%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) : ''; +% +% -#untaint date & pkgnum -my $date; -if ( $cgi->param('date') ) { - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date=$1; -} else { - $date=''; -} +<% include("/elements/header.html",'Expire package', menubar( + "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + 'Main Menu' => popurl(2) +)) %> -$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; -my $pkgnum = $1; + + + + -my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my %hash = $cust_pkg->hash; -$hash{expire}=$date; -my $new = new FS::cust_pkg ( \%hash ); -my $error = $new->replace($cust_pkg); -&eidiot($error) if $error; +<% $pkgnum %>: <% $part_pkg->pkg. ' - '. $part_pkg->comment %> -print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); +
+ + + + + + +
Cancel package on + +
m/d/y +
-%> + + + +
+ +