X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fmisc%2Fcust_main_note-import.cgi;h=2e7dc8b655c6fb4274f7c3a59aaa5e82a9f154d6;hp=b93c5c1cc5ff278b6b37ab0bc244993476ebb33f;hb=7d80f005462758e0271215240cdf99a9336f03dd;hpb=63a268637b2d51a8766412617724b9436439deb6 diff --git a/httemplate/misc/cust_main_note-import.cgi b/httemplate/misc/cust_main_note-import.cgi index b93c5c1cc..2e7dc8b65 100644 --- a/httemplate/misc/cust_main_note-import.cgi +++ b/httemplate/misc/cust_main_note-import.cgi @@ -39,24 +39,22 @@ custnum_obj.style.backgroundColor = '#dddddd'; - //alert('search for custnum ' + custnum + ', row#' + searchrow ); + function search_custnum_update(customers) { - function search_custnum_update(name) { - - var name = eval('(' + name + ')' ); + var customerArray = eval('(' + customers + ')'); custnum_obj.disabled = false; custnum_obj.style.backgroundColor = '#ffffff'; - if ( name.length > 0 ) { - //alert('custnum found: ' + name); + if ( customerArray.length == 0 ) { + custnum_obj.value = 'Not found'; + custnum_obj.style.color = '#ff0000'; + } else if ( customerArray.length >= 5 ) { + var name = customerArray[1]; opt(customer_select,custnum,name,'#000000'); customer_select.selectedIndex = customer_select.length - 1; custnum_obj.value = custnum; name_obj.value = name; - } else { - custnum_obj.value = 'Not found'; - custnum_obj.style.color = '#ff0000'; } } @@ -108,6 +106,7 @@ % my $fh = $cgi->upload('csvfile'); % my $csv = new Text::CSV_XS; % my $skip_fuzzies = $cgi->param('fuzzies') ? 0 : 1; +% my $use_agent_custid = $cgi->param('use_agent_custid') ? 1 : 0; % % if ( defined($fh) ) { @@ -118,7 +117,7 @@ -% my $agentnum => scalar($cgi->param('agentnum')), +% my $agentnum = scalar($cgi->param('agentnum')); % my $line; % my $row = 0; % while ( defined($line=<$fh>) ) { @@ -138,7 +137,10 @@ % next unless ( $last || $first || $note ); % my @cust_main = (); % warn "searching for: $last, $first" if ($first || $last); -% if ($custnum) { +% if ($agentnum && $custnum && $use_agent_custid) { +% @cust_main = qsearch('cust_main', { 'agent' => $agentnum, +% 'agent_custid' => $custnum } ); +% } elsif ($custnum) { # && !use_agent_custid % @cust_main = qsearch('cust_main', { 'custnum' => $custnum }); % } else { % @cust_main = FS::cust_main::smart_search( @@ -162,7 +164,7 @@ % my $i=0; % foreach (@cust_main) { - + % $i++; % } @@ -170,15 +172,15 @@ var customer_select<% $row %> = document.getElementById("cust_select<% $row %>"); customer_select<% $row %>.onchange = select_customer; - +
First Note to be added
- <% $first %> - + <% $first |h %> + - <% $last %> - + <% $last |h %> + <% $note %>