X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=5a574bceaf1a1b71c0b965244633a8b5e5425c9f;hb=e1aa1019e11d7a73fcf90a87dd59c71ed90adce5;hp=2c09c692cd03e1a000bf27d7a4721106116fc43d;hpb=63973c641c4be00765fa27e55c57cc5b9aa4da19;p=freeside.git
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index 2c09c692c..5a574bcea 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -150,15 +150,15 @@
% ? qq!!. encode_entities($company). ''
% : ' ';
%
-% my $status = $cust_main->status;
-% my $statuscol = $cust_main->statuscolor;
+% my $status_label = $cust_main->status_label;
+% my $statuscolor = $cust_main->statuscolor;
>
<% $cust_main->display_custnum %>
|
>
- <% ucfirst($status) %>
+ <% $status_label %>
|
>
<% "$last, $first" |h %>
@@ -233,7 +233,7 @@
% my $pkgnum = $_->pkgnum;
% my $part_pkg = $_->part_pkg;
%
-% my $pkg_comment = $part_pkg->pkg_comment(nopkgpart => 1);
+% my $pkg_comment = $part_pkg->pkg_comment( cust_pkg=>$_, nopkgpart=>1 );
% my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/
% ? ''
% : ';show=packages';
@@ -341,7 +341,12 @@ if ( $cgi->param('browse')
if ( $query eq 'custnum' ) {
if ( $conf->exists('cust_main-default_agent_custid') ) {
$sortby=\*display_custnum_sort;
- $orderby = "ORDER BY CASE WHEN agent_custid IS NOT NULL AND agent_custid != '' THEN CAST(agent_custid AS BIGINT) ELSE custnum END";
+ $orderby = "ORDER BY CASE WHEN agent_custid IS NOT NULL
+ AND agent_custid != ''
+ AND agent_custid ". regexp_sql. " '^[0-9]+\$'
+ THEN CAST(agent_custid AS BIGINT)
+ ELSE custnum
+ END";
} else {
$sortby=\*custnum_sort;
$orderby = "ORDER BY custnum";
@@ -393,6 +398,7 @@ if ( $cgi->param('browse')
push @qual, FS::cust_main->cancel_sql if $cgi->param('cancelled');
push @qual, FS::cust_main->prospect_sql if $cgi->param('prospect');
+ push @qual, FS::cust_main->ordered_sql if $cgi->param('ordered');
push @qual, FS::cust_main->active_sql if $cgi->param('active');
push @qual, FS::cust_main->inactive_sql if $cgi->param('inactive');
push @qual, FS::cust_main->susp_sql if $cgi->param('suspended');
@@ -470,7 +476,9 @@ if ( $cgi->param('browse')
$orderby = "ORDER BY LOWER(company || ' ' || last || ' ' || first )";
push @cust_main, smart_search(
'search' => scalar($cgi->param('search_cust')),
- 'no_fuzzy_on_exact' => ! $curuser->option('enable_fuzzy_on_exact'),
+ 'no_fuzzy_on_exact' => ! ( $curuser->option('enable_fuzzy_on_exact')
+ || $conf->exists('enable_fuzzy_on_exact')
+ ),
);
}
|