From: Christopher Burger Date: Tue, 3 Oct 2017 15:16:27 +0000 (-0400) Subject: Merge branch 'master' of ssh://git.freeside.biz/home/git/freeside X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=90430c5c67581b41b3c4ad48f70b9e443092977b;hp=8f1188e8550992bf3d9078e7a6042420eaf92bd5 Merge branch 'master' of ssh://git.freeside.biz/home/git/freeside --- diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index 21d598618..2ec87cd14 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -1049,8 +1049,9 @@ sub search { FS::UI::Web::cust_sql_fields($params->{'cust_fields'}), ); - my(@extra_headers) = (); - my(@extra_fields) = (); + my @extra_headers = (); + my @extra_fields = (); + my @extra_sort_fields = (); ## search contacts if ($params->{'contacts'}) { @@ -1134,6 +1135,7 @@ sub search { my $p = $a[!.--$headercount. q!]; $p; };!; + unshift @extra_sort_fields, ''; } } @@ -1149,21 +1151,23 @@ sub search { unshift @extra_headers, 'Referrals'; unshift @extra_fields, 'num_referrals'; + unshift @extra_sort_fields, 'num_referrals'; } my $select = join(', ', @select); my $sql_query = { - 'table' => 'cust_main', - 'select' => $select, - 'addl_from' => $addl_from, - 'hashref' => {}, - 'extra_sql' => $extra_sql, - 'order_by' => $orderby, - 'count_query' => $count_query, - 'extra_headers' => \@extra_headers, - 'extra_fields' => \@extra_fields, + 'table' => 'cust_main', + 'select' => $select, + 'addl_from' => $addl_from, + 'hashref' => {}, + 'extra_sql' => $extra_sql, + 'order_by' => $orderby, + 'count_query' => $count_query, + 'extra_headers' => \@extra_headers, + 'extra_fields' => \@extra_fields, + 'extra_sort_fields' => \@extra_sort_fields, }; $sql_query; diff --git a/conf/invoice_latex b/conf/invoice_latex index 5c6090e08..a710cddec 100644 --- a/conf/invoice_latex +++ b/conf/invoice_latex @@ -63,6 +63,10 @@ \LTchunksize=40 + +\begin{document} + + \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{1pt} @@ -268,7 +272,6 @@ \\ } -\begin{document} % Headers and footers defined for the first page \addressinset \rule{0.5cm}{0cm} \makebox{ diff --git a/conf/quotation_latex b/conf/quotation_latex index 25228dcb9..13fc42978 100644 --- a/conf/quotation_latex +++ b/conf/quotation_latex @@ -39,6 +39,10 @@ \LTchunksize=40 + +\begin{document} + + \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{1pt} @@ -200,7 +204,6 @@ } -\begin{document} % Headers and footers defined for the first page \addressinset \rule{0.5cm}{0cm} \makebox{ diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index 7197bbde7..30162506f 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -13,6 +13,10 @@ \&FS::UI::Web::cust_fields, @extra_fields, ], + 'sort_fields' => [ + FS::UI::Web::cust_sort_fields(), + @extra_sort_fields, + ], 'color' => [ FS::UI::Web::cust_colors(), map '', @extra_fields ], @@ -68,16 +72,20 @@ for my $param (qw( classnum refnum pkg_classnum )) { $search_hash{$param} = [ $cgi->param($param) ]; } +my $params = $cgi->Vars; + #contacts $search_hash{'contacts'} = { - map { $_ => $cgi->param($_), } grep { /^(contacts_*)/ && $cgi->param($_) } keys $cgi->Vars + map { $_ => $cgi->param($_), } + grep { /^(contacts_*)/ && $cgi->param($_) } + keys %$params }; #tags -my $params = $cgi->Vars; $search_hash{'tagnum'} = [ map { /^tagnum(\d+)/ && $1 } - grep { /^tagnum(\d+)/ && $cgi->param($_) } keys %$params + grep { /^tagnum(\d+)/ && $cgi->param($_) } + keys %$params ]; ### @@ -115,9 +123,10 @@ $search_hash{'current_balance'} = ### my $sql_query = FS::cust_main::Search->search(\%search_hash); -my $count_query = delete($sql_query->{'count_query'}); -my @extra_headers = @{ delete($sql_query->{'extra_headers'}) }; -my @extra_fields = @{ delete($sql_query->{'extra_fields'}) }; +my $count_query = delete($sql_query->{'count_query'}); +my @extra_headers = @{ delete($sql_query->{'extra_headers'}) }; +my @extra_fields = @{ delete($sql_query->{'extra_fields'}) }; +my @extra_sort_fields = @{ delete($sql_query->{'extra_sort_fields'}) }; my $link = [ "${p}view/cust_main.cgi?", 'custnum' ];