customer bill/ship location refactoring, #940
[freeside.git] / FS / FS / ClientAPI / MasonComponent.pm
index 76d406c..534b48a 100644 (file)
@@ -36,7 +36,7 @@ my %session_callbacks = (
     my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } )
       or return "unknown custnum $custnum";
     my %args = @$argsref;
-    $args{object} = $cust_main;
+    $args{object} = $cust_main->bill_location;
     @$argsref = ( %args );
     return ''; #no error
   },
@@ -74,6 +74,7 @@ my %session_callbacks = (
 
     my %args = @$argsref;
     $args{part_pkg} = \@part_pkg;
+    $args{first_svc} = \@first_svc;
     @$argsref = ( %args );
     return ''; #no error
 
@@ -109,6 +110,7 @@ sub mason_comp {
 
   my $conf = new FS::Conf;
   $FS::Mason::Request::FSURL = $conf->config('selfservice_server-base_url');
+  $FS::Mason::Request::FSURL .= '/' unless $FS::Mason::Request::FSURL =~ /\/$/;
   $FS::Mason::Request::QUERY_STRING = $packet->{'query_string'} || '';
 
   $outbuf = '';