summaryrefslogtreecommitdiff
path: root/httemplate/misc/location.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/misc/location.cgi')
-rw-r--r--httemplate/misc/location.cgi19
1 files changed, 19 insertions, 0 deletions
diff --git a/httemplate/misc/location.cgi b/httemplate/misc/location.cgi
new file mode 100644
index 000000000..419c59f2e
--- /dev/null
+++ b/httemplate/misc/location.cgi
@@ -0,0 +1,19 @@
+<% objToJson(\%hash) %>
+<%init>
+
+my $locationnum = $cgi->param('arg');
+
+my $cust_location = qsearchs({
+ 'select' => 'cust_location.*',
+ 'table' => 'cust_location',
+ 'hashref' => { 'locationnum' => $locationnum },
+ 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )',
+ 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+});
+
+my %hash = ();
+%hash = map { $_ => $cust_location->$_() }
+ qw( address1 address2 city county state zip country )
+ if $cust_location;
+
+</%init>