better error message when you don't select a package
[freeside.git] / FS / FS / ClientAPI / Signup.pm
index 0bb9f7b..710c16c 100644 (file)
@@ -116,6 +116,7 @@ sub new_customer {
 
   $packet->{'pkgpart'} =~ /^(\d+)$/ or '' =~ /^()$/;
   my $pkgpart = $1;
+  $error ||= 'Please select a package' unless $pkgpart; #msgcat
 
   my $part_pkg =
     qsearchs( 'part_pkg', { 'pkgpart' => $pkgpart } )
@@ -169,7 +170,7 @@ sub new_customer {
       #should check list for errors...
       #$cust_main->suspend;
       local $FS::svc_Common::noexport_hack = 1;
-      $cust_main->cancel;
+      $cust_main->cancel('quiet'=>1);
 
       $error = '_decline';
     }
@@ -181,3 +182,4 @@ sub new_customer {
 
 }
 
+1;