diff options
author | mark <mark> | 2011-07-01 05:33:55 +0000 |
---|---|---|
committer | mark <mark> | 2011-07-01 05:33:55 +0000 |
commit | 4b80fe118da16b21603fcdbd090bc03d8fbf0578 (patch) | |
tree | fe5960c7c4ad7514dc46bd37e8e09cb86f266845 /FS/FS/cust_main | |
parent | 2c69cd41531a493c45ea72da3aa379fcc9f70aa9 (diff) |
send email from customer view, #13444
Diffstat (limited to 'FS/FS/cust_main')
-rw-r--r-- | FS/FS/cust_main/Search.pm | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index 06a4522f4..5636fc6e4 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -471,6 +471,33 @@ sub search { my @where = (); my $orderby; + # initialize these to prevent warnings + $params = { + 'custnum' => '', + 'agentnum' => '', + 'usernum' => '', + 'status' => '', + 'address' => '', + 'paydate_year' => '', + 'invoice_terms' => '', + 'custbatch' => '', + %$params + }; + + ## + # explicit custnum(s) + ## + + if ( $params->{'custnum'} ) { + my @custnums = ref($params->{'custnum'}) ? + @{ $params->{'custnum'} } : + $params->{'custnum'}; + push @where, + 'cust_main.custnum IN (' . + join(',', map { $_ =~ /^(\d+)$/ ? $1 : () } @custnums ) . + ')' if scalar(@custnums) > 0; + } + ## # parse agent ## |