From 5ea451e310506e07a26887897c5051bb02ab62d1 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 30 Sep 2017 13:42:46 -0700 Subject: move \begin{document} earlier to prevent a large summary from pushing things off the bottom of the page, RT#77899. ref https://tex.stackexchange.com/questions/55331/text-is-going-below-the-page-bottom : "need to place any contents that is actually typeset within ghte document environment" --- conf/invoice_latex | 5 ++++- conf/quotation_latex | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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{ -- cgit v1.2.1 From cd1555c36924e21a9894b29071d76911ec277d9a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 1 Oct 2017 14:39:47 -0700 Subject: fix error w/current perl - can't call keys on a scalar hashref anymore, RT#77532 --- httemplate/search/cust_main.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index 7197bbde7..cb8d66ef8 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -68,16 +68,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 ]; ### -- cgit v1.2.1 From 467d7dc761ec4492aa285771920be1def76ea831 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 1 Oct 2017 15:17:35 -0700 Subject: sort by referral count, RT#75757 --- FS/FS/cust_main/Search.pm | 26 +++++++++++++++----------- httemplate/search/cust_main.html | 11 ++++++++--- 2 files changed, 23 insertions(+), 14 deletions(-) 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/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index cb8d66ef8..d9499e9b0 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 ], @@ -119,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' ]; -- cgit v1.2.1 From 2e5d7c4e1a26af8a8c0f4b5f08f1a683293b9686 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 1 Oct 2017 15:18:03 -0700 Subject: sort by referral count, RT#75757 --- httemplate/search/cust_main.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/httemplate/search/cust_main.html b/httemplate/search/cust_main.html index d9499e9b0..30162506f 100755 --- a/httemplate/search/cust_main.html +++ b/httemplate/search/cust_main.html @@ -13,10 +13,10 @@ \&FS::UI::Web::cust_fields, @extra_fields, ], - #'sort_fields' => [ - # FS::UI::Web::cust_sort_fields(), - # @extra_sort_fields, - #], + 'sort_fields' => [ + FS::UI::Web::cust_sort_fields(), + @extra_sort_fields, + ], 'color' => [ FS::UI::Web::cust_colors(), map '', @extra_fields ], -- cgit v1.2.1