summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2006-11-24 08:49:09 +0000
committerivan <ivan>2006-11-24 08:49:09 +0000
commit39fd666a49b2be516967131a46891f17ce0101da (patch)
treee5e3ead6d6943990466724c3c6bc4b224fdb5a79 /httemplate
parent5f6615875ca497d46c4f8cd810310d4b2db24bfd (diff)
add less than and greater than amounts to credit and payment searches
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/elements/tr-input-beginning_ending.html4
-rw-r--r--httemplate/elements/tr-input-lessthan_greaterthan.html13
-rwxr-xr-xhttemplate/search/cust_credit.html23
-rwxr-xr-xhttemplate/search/cust_pay.cgi2
-rw-r--r--httemplate/search/report_cust_credit.html40
-rw-r--r--httemplate/search/report_cust_pay.html6
6 files changed, 52 insertions, 36 deletions
diff --git a/httemplate/elements/tr-input-beginning_ending.html b/httemplate/elements/tr-input-beginning_ending.html
index a8ab6ed10..397f7498a 100644
--- a/httemplate/elements/tr-input-beginning_ending.html
+++ b/httemplate/elements/tr-input-beginning_ending.html
@@ -5,7 +5,7 @@
<TR>
- <TD ALIGN="right">From: </TD>
+ <TD ALIGN="right">From date: </TD>
<TD><INPUT TYPE="text" NAME="beginning" ID="beginning_text" VALUE="" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="../images/calendar.png" ID="beginning_button" STYLE="cursor: pointer" TITLE="Select date"><BR><i>m/d/y<% $time_hint %></i></TD>
<SCRIPT TYPE="text/javascript">
Calendar.setup({
@@ -19,7 +19,7 @@
</TR>
<TR>
- <TD ALIGN="right">To: </TD>
+ <TD ALIGN="right">To date: </TD>
<TD><INPUT TYPE="text" NAME="ending" ID="ending_text" VALUE="" SIZE=<%$size%> MAXLENGTH=<%$maxlength%>> <IMG SRC="../images/calendar.png" ID="ending_button" STYLE="cursor: pointer" TITLE="Select date"><BR><i>m/d/y<% $time_hint %></i></TD>
<SCRIPT TYPE="text/javascript">
Calendar.setup({
diff --git a/httemplate/elements/tr-input-lessthan_greaterthan.html b/httemplate/elements/tr-input-lessthan_greaterthan.html
new file mode 100644
index 000000000..16c2ed9fc
--- /dev/null
+++ b/httemplate/elements/tr-input-lessthan_greaterthan.html
@@ -0,0 +1,13 @@
+<TR>
+ <TD ALIGN="right"><% $opt{label} %> less than: </TD>
+ <TD><INPUT TYPE="text" NAME="<% $opt{field} %>_lt" SIZE=7></TD>
+</TR>
+
+<TR>
+ <TD ALIGN="right"><% $opt{label} %> greater than: </TD>
+ <TD><INPUT TYPE="text" NAME="<% $opt{field} %>_gt" SIZE=7></TD>
+</TR>
+
+<%init>
+ my %opt = @_;
+</%init>
diff --git a/httemplate/search/cust_credit.html b/httemplate/search/cust_credit.html
index 80cfc4585..c52394a5b 100755
--- a/httemplate/search/cust_credit.html
+++ b/httemplate/search/cust_credit.html
@@ -15,26 +15,11 @@
% $title = $agent->agent. " $title";
% }
%
-% #false laziness with cust_pkg.cgi and cust_pay.cgi
-% if ( $cgi->param('beginning')
-% && $cgi->param('beginning') =~ /^([ 0-9\-\/]{1,10})$/ ) {
-% my $beginning = str2time($1);
-% push @search, "_date >= $beginning ";
-% }
-% if ( $cgi->param('ending')
-% && $cgi->param('ending') =~ /^([ 0-9\-\/]{1,10})$/ ) {
-% my $ending = str2time($1) + 86399;
-% push @search, " _date <= $ending ";
-% }
+% my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
+% push @search, "_date >= $beginning ",
+% "_date <= $ending";
%
-% if ( $cgi->param('begin')
-% && $cgi->param('begin') =~ /^(\d+)$/ ) {
-% push @search, "_date >= $1 ";
-% }
-% if ( $cgi->param('end')
-% && $cgi->param('end') =~ /^(\d+)$/ ) {
-% push @search, " _date < $1 ";
-% }
+% push @search, FS::UI::Web::parse_lt_gt($cgi, 'amount' );
%
% #here is the agent virtualization
% push @search, $FS::CurrentUser::CurrentUser->agentnums_sql;
diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi
index 0664bf796..87da1791b 100755
--- a/httemplate/search/cust_pay.cgi
+++ b/httemplate/search/cust_pay.cgi
@@ -80,6 +80,8 @@
% my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
% push @search, "_date >= $beginning ",
% "_date <= $ending";
+%
+% push @search, FS::UI::Web::parse_lt_gt($cgi, 'paid' );
%
% $orderby = '_date';
%
diff --git a/httemplate/search/report_cust_credit.html b/httemplate/search/report_cust_credit.html
index 96c0b5acb..ab481025e 100644
--- a/httemplate/search/report_cust_credit.html
+++ b/httemplate/search/report_cust_credit.html
@@ -6,30 +6,31 @@
<TABLE>
<TR>
<TD ALIGN="right">Credits by employee: </TD>
-%
-% my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_credit")
-% or die dbh->errstr;
-% $sth->execute or die $sth->errstr;
-% my @otakers = map { $_->[0] } @{$sth->fetchall_arrayref};
-%
-
- <TD><SELECT NAME="otaker">
- <OPTION VALUE="">all</OPTION>
-% foreach my $otaker ( @otakers ) {
-
- <OPTION VALUE="<% $otaker %>"><% $otaker %></OPTION>
-% }
-
- </SELECT>
+ <TD>
+ <SELECT NAME="otaker">
+ <OPTION VALUE="">all</OPTION>
+% foreach my $otaker ( @otakers ) {
+ <OPTION VALUE="<% $otaker %>"><% $otaker %></OPTION>
+% }
+ </SELECT>
</TD>
</TR>
+
<% include( '/elements/tr-select-agent.html',
$cgi->param('agentnum'),
'label' => 'for agent: ',
)
%>
+
<% include( '/elements/tr-input-beginning_ending.html' ) %>
+
+ <% include( '/elements/tr-input-lessthan_greaterthan.html',
+ 'label' => 'Amount',
+ 'field' => 'amount',
+ )
+ %>
+
</TABLE>
<BR>
@@ -38,3 +39,12 @@
</FORM>
<% include('/elements/footer.html') %>
+
+<%init>
+
+my $sth = dbh->prepare("SELECT DISTINCT otaker FROM cust_credit")
+ or die dbh->errstr;
+$sth->execute or die $sth->errstr;
+my @otakers = map { $_->[0] } @{$sth->fetchall_arrayref};
+
+</%init>
diff --git a/httemplate/search/report_cust_pay.html b/httemplate/search/report_cust_pay.html
index a3e43f80a..90c5d255d 100644
--- a/httemplate/search/report_cust_pay.html
+++ b/httemplate/search/report_cust_pay.html
@@ -56,6 +56,12 @@
<% include( '/elements/tr-input-beginning_ending.html' ) %>
+ <% include( '/elements/tr-input-lessthan_greaterthan.html',
+ 'label' => 'Amount',
+ 'field' => 'paid',
+ )
+ %>
+
</TABLE>
<BR>