summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-13 14:34:46 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-13 14:34:46 -0700
commit15dbf6151b7e6e3b32e55fd6609725f650349460 (patch)
tree22ad4d265853ae3637fa92478c285f1ba7bf3491 /FS
parentcc6bedada3c99e3e9ca4748546f3b4ab847c3cba (diff)
quick payment entry: if both a custnum and an agent_custid match, allow the user to pick, RT#18100
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_main/Search.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index 75859c335..3a8acb2de 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -140,10 +140,12 @@ sub smart_search {
my $num = $1;
if ( $num =~ /^(\d+)$/ && $num <= 2147483647 ) { #need a bigint custnum? wow
+ my $agent_custid_null = $conf->exists('cust_main-default_agent_custid')
+ ? ' AND agent_custid IS NULL ' : '';
push @cust_main, qsearch( {
'table' => 'cust_main',
'hashref' => { 'custnum' => $num, %options },
- 'extra_sql' => " AND $agentnums_sql", #agent virtualization
+ 'extra_sql' => " AND $agentnums_sql $agent_custid_null",
} );
}