projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
1c773e9
)
add package search by next bill date to main menu
author
ivan
<ivan>
Sat, 4 May 2002 01:11:04 +0000
(
01:11
+0000)
committer
ivan
<ivan>
Sat, 4 May 2002 01:11:04 +0000
(
01:11
+0000)
httemplate/index.html
patch
|
blob
|
history
httemplate/search/cust_pkg.cgi
patch
|
blob
|
history
diff --git
a/httemplate/index.html
b/httemplate/index.html
index
c764e76
..
3e65702
100644
(file)
--- 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><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>
<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>
<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>
</UL>
Invoices
<UL>
diff --git
a/httemplate/search/cust_pkg.cgi
b/httemplate/search/cust_pkg.cgi
index
8c5d35b
..
ec1bda9
100755
(executable)
--- 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;
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 ";
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})$/ ) {
&& $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";
$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;
my $sth = dbh->prepare($statement)
or die dbh->errstr. " doing $statement";
$sth->execute or die "Error executing \"$statement\": ". $sth->errstr;