1 <% objToJson(\%hash) %>
4 my $locationnum = $cgi->param('arg');
6 my $curuser = $FS::CurrentUser::CurrentUser;
8 my $cust_location = qsearchs({
9 'select' => 'cust_location.*',
10 'table' => 'cust_location',
11 'hashref' => { 'locationnum' => $locationnum },
12 'addl_from' => ' LEFT JOIN cust_main USING ( custnum ) ',
13 ' LEFT JOIN prospect_main USING ( prospectnum ) ',
14 'extra_sql' => ' AND ( '.
15 ' ( custnum IS NOT NULL AND '.
16 $curuser->agentnums_sql( table=>'cust_main' ).
19 ' ( prospectnum IS NOT NULL AND '.
20 $curuser->agentnums_sql( table=>'prospect_main' ).
26 %hash = map { $_ => $cust_location->$_() }
27 qw( address1 address2 city county state zip country )