diff options
-rw-r--r-- | httemplate/index.html | 3 | ||||
-rwxr-xr-x | httemplate/search/cust_pkg.cgi | 7 |
2 files changed, 6 insertions, 4 deletions
diff --git a/httemplate/index.html b/httemplate/index.html index c764e7602..3e657025f 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -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> @@ -120,6 +120,7 @@ <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> diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index 8c5d35be5..ec1bda900 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -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; |