summaryrefslogtreecommitdiff
path: root/httemplate/search
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/search
parent5f6615875ca497d46c4f8cd810310d4b2db24bfd (diff)
add less than and greater than amounts to credit and payment searches
Diffstat (limited to 'httemplate/search')
-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
4 files changed, 37 insertions, 34 deletions
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>