X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.html;h=c050c5bd1a090196958743ada807df5440ec3a8c;hb=2f673cd6e61a8c67c4ef89d11cae3e96a7fac306;hp=1889b6c828031b4721b8d5c7994abd5d2609f0d6;hpb=95cbde56f34557a7fcb66a9208eca3fa4cf14bcd;p=freeside.git diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index 1889b6c82..c050c5bd1 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -12,8 +12,29 @@ \&FS::UI::Web::cust_fields, @extra_fields, ], + 'color' => [ FS::UI::Web::cust_colors(), + map '', @extra_fields + ], + 'style' => [ FS::UI::Web::cust_styles(), + map '', @extra_fields + ], + 'align' => [ FS::UI::Web::cust_aligns(), + map '', @extra_fields + ], + 'links' => [ ( map { $_ ne 'Cust. Status' ? $link : '' } + FS::UI::Web::cust_header( + $cgi->param('cust_fields') + ) + ), + map '', @extra_fields + ], ) %> +<%once> + +my $link = [ "${p}view/cust_main.cgi?", 'custnum' ]; + + <%init> die "access denied" @@ -68,6 +89,24 @@ foreach my $field (qw( signupdate )) { } +### +# payby +### + +my @payby = grep /^([A-Z]{4})$/, $cgi->param('payby'); +if ( @payby ) { + push @where, '( '. join(' OR ', map "cust_main.payby = '$_'", @payby). ' )'; +} + +## +# 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 +122,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) = ();