summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorjeff <jeff>2007-12-19 21:05:37 +0000
committerjeff <jeff>2007-12-19 21:05:37 +0000
commit00aed756e1449f4d0847b1d05f96208d607b4711 (patch)
treefedefc337b3e7e0b41f2285c77c8a26f1c9c15ce /httemplate/search
parentb91858c22eae141b31fe0024ee2a04bdeae2f3c5 (diff)
add options for balance over/under to advanced customer report
Diffstat (limited to 'httemplate/search')
-rwxr-xr-xhttemplate/search/cust_main.html15
-rwxr-xr-xhttemplate/search/report_cust_main.html6
2 files changed, 20 insertions, 1 deletions
diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html
index 1889b6c82..00fd1531a 100755
--- a/httemplate/search/cust_main.html
+++ b/httemplate/search/cust_main.html
@@ -69,6 +69,15 @@ foreach my $field (qw( signupdate )) {
}
##
+# amounts
+##
+
+my $balance_sql = FS::cust_main->balance_sql();
+
+push @where, map { s/current_balance/$balance_sql/; $_ }
+ FS::UI::Web::parse_lt_gt($cgi, 'current_balance');
+
+##
# setup queries, subs, etc. for the search
##
@@ -83,7 +92,11 @@ my $addl_from = 'LEFT JOIN cust_pkg USING ( custnum ) ';
my $count_query = "SELECT COUNT(*) FROM cust_main $extra_sql";
-my $select = '*';
+my $select = join(', ',
+ 'cust_main.custnum',
+ FS::UI::Web::cust_sql_fields($cgi->param('cust_fields')),
+ );
+
my (@extra_headers) = ();
my (@extra_fields) = ();
diff --git a/httemplate/search/report_cust_main.html b/httemplate/search/report_cust_main.html
index 9e8cc8177..50bc67b3d 100755
--- a/httemplate/search/report_cust_main.html
+++ b/httemplate/search/report_cust_main.html
@@ -30,6 +30,12 @@
% }
+ <% include( '/elements/tr-input-lessthan_greaterthan.html',
+ label => 'Current Balance',
+ field => 'current_balance',
+ )
+ %>
+
<TR>
<TD ALIGN="right" VALIGN="center">Include cancelled packages</TD>
<TD><INPUT TYPE="checkbox" NAME="cancelled_pkgs"></TD>