[freeside-commits] branch master updated. 403bd5f61004717ecfecf8c5211141939e3b7176

Ivan ivan at 420.am
Tue Dec 23 12:57:38 PST 2014


The branch, master has been updated
       via  403bd5f61004717ecfecf8c5211141939e3b7176 (commit)
      from  3b1fda960515886ee4306b94fc60ccad196f1358 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 403bd5f61004717ecfecf8c5211141939e3b7176
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Dec 23 12:57:35 2014 -0800

    default tags on API signup, RT#32727

diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm
index 554fc30..6116609 100644
--- a/FS/FS/ClientAPI/Signup.pm
+++ b/FS/FS/ClientAPI/Signup.pm
@@ -24,6 +24,7 @@ use FS::queue;
 use FS::reg_code;
 use FS::payby;
 use FS::banned_pay;
+use FS::part_tag;
 
 $DEBUG = 1;
 $me = '[FS::ClientAPI::Signup]';
@@ -521,6 +522,27 @@ sub new_customer {
 
   #shares some stuff with htdocs/edit/process/cust_main.cgi... take any
   # common that are still here and library them.
+
+  my %cust_main = (
+    'agentnum' => $agentnum,
+    'refnum'   => $packet->{refnum}
+                  || $conf->config('signup_server-default_refnum'),
+    'tagnum'   => [ FS::part_tag->default_tags ],
+
+    ( map { $_ => $packet->{$_} } qw(
+            ss stateid stateid_state
+
+            payby
+            payinfo paycvv paydate payname paystate paytype
+            paystart_month paystart_year payissue
+            payip
+
+            referral_custnum comments
+          )
+    ),
+
+  );
+
   my $template_custnum = $conf->config('signup_server-prepaid-template-custnum');
   my $cust_main;
   if ( $template_custnum && $packet->{prepaid_shortform} ) {
@@ -528,27 +550,10 @@ sub new_customer {
     my $template_cust = qsearchs('cust_main', { 'custnum' => $template_custnum } );
     return { 'error' => 'Configuration error' } unless $template_cust;
     $cust_main = new FS::cust_main ( {
-      'agentnum'      => $agentnum,
-      'refnum'        => $packet->{refnum}
-                         || $conf->config('signup_server-default_refnum'),
-
-      ( map { $_ => $template_cust->$_ } qw( 
-              last first company daytime night fax mobile
-            )
+      %cust_main,
+      map { $_ => $template_cust->$_ } qw( 
+        last first company daytime night fax mobile
       ),
-
-      ( map { $_ => $packet->{$_} } qw(
-              ss stateid stateid_state
-
-              payby
-              payinfo paycvv paydate payname paystate paytype
-              paystart_month paystart_year payissue
-              payip
-
-              referral_custnum comments
-            )
-      ),
-
     } );
 
     $bill_hash = { $template_cust->bill_location->location_hash };
@@ -557,23 +562,11 @@ sub new_customer {
   } else {
 
     $cust_main = new FS::cust_main ( {
-      #'custnum'          => '',
-      'agentnum'      => $agentnum,
-      'refnum'        => $packet->{refnum}
-                         || $conf->config('signup_server-default_refnum'),
-
+      %cust_main,
       map { $_ => $packet->{$_} } qw(
-        last first ss company 
-        daytime night fax mobile
-        stateid stateid_state
-        payby
-        payinfo paycvv paydate payname paystate paytype
-        paystart_month paystart_year payissue
-        payip
+        last first company daytime night fax mobile
         override_ban_warn
-        referral_custnum comments
       ),
-
     } );
   }
 
@@ -933,15 +926,15 @@ sub new_customer_minimal {
   # common that are still here and library them.
 
   my $cust_main = new FS::cust_main ( {
-      #'custnum'          => '',
-      'agentnum'      => $agentnum,
-      'refnum'        => $packet->{refnum}
-                         || $conf->config('signup_server-default_refnum'),
-      'payby'         => 'BILL',
+      'agentnum' => $agentnum,
+      'refnum'   => $packet->{refnum}
+                    || $conf->config('signup_server-default_refnum'),
+      'tagnum'   => [ FS::part_tag->default_tags ],
+      'payby'    => 'BILL',
 
       map { $_ => $packet->{$_} } qw(
-        last first ss company 
-        daytime night fax mobile
+        last first company daytime night fax mobile
+        ss
       ),
 
   } );

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/ClientAPI/Signup.pm |   75 ++++++++++++++++++++-------------------------
 1 file changed, 34 insertions(+), 41 deletions(-)




More information about the freeside-commits mailing list