diff options
author | ivan <ivan> | 2002-06-13 00:53:26 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-06-13 00:53:26 +0000 |
commit | afe61aa1e4158a49ba67740d947a991e285d5fb1 (patch) | |
tree | 264aeffdecde3d76a716e91e374e890ba5bbd819 /httemplate/search/cust_main.cgi | |
parent | 8646bec77602ba7b5b9928a8d408ff5bea5b0bc1 (diff) |
search on customer number (Bug#422)
Diffstat (limited to 'httemplate/search/cust_main.cgi')
-rwxr-xr-x | httemplate/search/cust_main.cgi | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index d9d4e657c..247cf8fd6 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -192,6 +192,8 @@ if ( $cgi->param('browse') @cust_main=(); $sortby = \*last_sort; + push @cust_main, @{&custnumsearch} + if $cgi->param('custnum_on') && $cgi->param('custnum_text'); push @cust_main, @{&cardsearch} if $cgi->param('card_on') && $cgi->param('card'); push @cust_main, @{&lastsearch} @@ -446,6 +448,16 @@ sub custnum_sort { $a->getfield('custnum') <=> $b->getfield('custnum'); } +sub custnumsearch { + + my $custnum = $cgi->param('custnum_text'); + $custnum =~ s/\D//g; + $custnum =~ /^(\d{1,23})$/ or eidiot "Illegal customer number\n"; + my $custnum = $1; + + [ qsearchs('cust_main', { 'custnum' => $custnum } ) ]; +} + sub cardsearch { my($card)=$cgi->param('card'); |