pick/enter a location when ordering a package, RT#4499
[freeside.git] / httemplate / misc / location.cgi
diff --git a/httemplate/misc/location.cgi b/httemplate/misc/location.cgi
new file mode 100644 (file)
index 0000000..3c3a855
--- /dev/null
@@ -0,0 +1,18 @@
+<% objToJson(\%hash) %>
+<%init>
+
+my $locationnum = $cgi->param('arg');
+
+my $cust_location = qsearchs({
+  '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>