add package search by next bill date to main menu
authorivan <ivan>
Sat, 4 May 2002 01:11:04 +0000 (01:11 +0000)
committerivan <ivan>
Sat, 4 May 2002 01:11:04 +0000 (01:11 +0000)
httemplate/index.html
httemplate/search/cust_pkg.cgi

index c764e76..3e65702 100644 (file)
@@ -55,7 +55,7 @@
       <BR><FORM ACTION="search/cust_main.cgi" METHOD="POST">Credit card # <INPUT TYPE="hidden" NAME="card_on" VALUE="1"><INPUT TYPE="text" NAME="card"><INPUT TYPE="submit" VALUE="Search"></FORM>
       <FORM ACTION="search/cust_bill.cgi" METHOD="POST">Invoice # <INPUT TYPE="text" NAME="invnum" SIZE="8"><INPUT TYPE="submit" VALUE="Search"></FORM>
       <FORM ACTION="search/cust_pay.cgi" METHOD="POST">Check # <INPUT TYPE="text" NAME="payinfo" SIZE="8"><INPUT TYPE="hidden" NAME="payby" VALUE="BILL"><INPUT TYPE="submit" VALUE="Search"></FORM>
-      <BR><A HREF="browse/cust_pay_batch.cgi">View pending credit card batch</A>
+      <BR><A HREF="browse/cust_pay_batch.cgi">View pending credit card batch</A>      <BR><BR><A HREF="search/cust_pkg.html">Packages (by next bill date range)</A>
       <BR><BR>Invoice reports
             <UL>
               <LI><a href="search/cust_bill_event.html">Invoice event errors (failed credit cards)</a>
       <UL>
         <LI><A HREF="search/cust_pkg.cgi?pkgnum">packages (by package number)</A>
         <LI><A HREF="search/cust_pkg.cgi?APKG_pkgnum">packages with unconfigured services (by package number)</A>
+        <LI><A HREF="search/cust_pkg.html">packages (by next bill date range)</A>
       </UL>
       Invoices
       <UL>
index 8c5d35b..ec1bda9 100755 (executable)
@@ -19,20 +19,21 @@ my @cust_pkg;
 
 if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
   $sortby=\*bill_sort;
-  my($beginning, $ending) = (0, 0);
   my $range = '';
   if ( $cgi->param('beginning')
        && $cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/ ) {
     my $beginning = str2time($1);
     $range = " WHERE bill >= $beginning ";
-  } elsif ( $cgi->param('ending')
+  }
+  if ( $cgi->param('ending')
             && $cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/ ) {
-    $ending = str2time($1) + 86400;
+    my $ending = str2time($1) + 86400;
     $range .= ( $range ? ' AND ' : ' WHERE ' ). " bill <= $ending ";
   }
 
   #false laziness with below
   my $statement = "SELECT COUNT(*) FROM cust_pkg $range";
+  warn $statement;
   my $sth = dbh->prepare($statement)
     or die dbh->errstr. " doing $statement";
   $sth->execute or die "Error executing \"$statement\": ". $sth->errstr;