default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / edit / process / quick-cust_pkg.cgi
index 5afddde..3f1984f 100644 (file)
@@ -20,7 +20,7 @@
 %      "view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#$frag";
 %  }
 % 
-<% header('Package ordered') %>
+<& /elements/header-popup.html, 'Package ordered' &>
   <SCRIPT TYPE="text/javascript">
     // XXX fancy ajax rebuild table at some point, but a page reload will do for now
 
@@ -189,7 +189,18 @@ if ( $quotationnum ) {
   )
   : ();
 
-  #XXX handle new location
+  if ( $locationnum == -1 ) {
+    my $cust_location = FS::cust_location->new({
+      'custnum'     => $cust_main ? $cust_main->custnum : '',
+      'prospectnum' => $prospect_main ? $prospect_main->prospectnum : '',
+      map { $_ => scalar($cgi->param($_)) }
+        FS::cust_main->location_fields
+    });
+    $opt{'cust_location'} = $cust_location;
+  } else {
+    $opt{'locationnum'} = $locationnum;
+  }
+
   $error = $quotation_pkg->insert(%opt);
 
 } else {