fix adding a new location on a quotation, RT#73236
[freeside.git] / httemplate / edit / process / quick-cust_pkg.cgi
index da5afe4..6a346e0 100644 (file)
@@ -189,7 +189,18 @@ if ( $quotationnum ) {
   )
   : ();
 
-  #XXX handle new location
+  if ( $locationnum == -1 ) {
+    my $cust_location = FS::cust_location->new({
+      'custnum'     => $custnum,
+      'prospectnum' => $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 {