[freeside-commits] freeside/httemplate/edit cust_main.cgi, 1.106, 1.107 svc_dsl.cgi, 1.7, 1.8

Ivan,,, ivan at wavetail.420.am
Mon Mar 21 23:00:56 PDT 2011


Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail.420.am:/tmp/cvs-serv24450/httemplate/edit

Modified Files:
	cust_main.cgi svc_dsl.cgi 
Log Message:
new customer from prospect qualification, RT#7111

Index: svc_dsl.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/svc_dsl.cgi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- svc_dsl.cgi	20 Jan 2011 20:46:29 -0000	1.7
+++ svc_dsl.cgi	22 Mar 2011 06:00:54 -0000	1.8
@@ -18,8 +18,7 @@
 
 my @fields = ();
 
-my $html_foot = sub {
-    return "
+my $html_foot = sub { "
 <SCRIPT TYPE=\"text/javascript\">
   function ikano_loop_type_changed() {
 	var loop_type = document.getElementById('loop_type').value;
@@ -30,8 +29,8 @@
 	}
 	else phonenum.disabled = false;
   }
-</SCRIPT>";
-};
+</SCRIPT>
+"; };
 
 my $edit_cb = sub {
     my( $cgi,$svc_x, $part_svc,$cust_pkg, $fields1,$opt) = @_;
@@ -105,15 +104,18 @@
 							    .$qual->qualnum;
 	    }
 
-	    my @addl_fields = ( 
+            splice @fields, -1, 0,
 		{ field => 'loop_type',
 		  type => 'select',
 		  options => [ '', '0' ],
 		  labels => { '' => 'Line-share', '0', => 'Standalone' },
 		  onchange => 'ikano_loop_type_changed',
 		},
+            ;
+
+            push @fields,
 		'password', 
-		{ field => 'isp_chg', type => 'checkbox', },
+                { field => 'isp_chg', type => 'checkbox', value=>'Y', },
 		'isp_prev',
 		{ field => 'vendor_qual_id', 
 		  type => 'select',
@@ -130,12 +132,11 @@
 		    time2str($date_format,$ddd),
 		  value => $ddd, 
 		},
-	    );
-	    push @fields, @addl_fields;
+            ;
 	}
 	# else add any other export-specific stuff here
-    }
-    else { # display non-export and non-Ikano fields
+
+    } else { # display non-export and non-Ikano fields
 	push @fields, qw( rate_band circuitnum vpi vci );
     }
 };

Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main.cgi,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -w -d -r1.106 -r1.107
--- cust_main.cgi	11 Oct 2010 09:03:14 -0000	1.106
+++ cust_main.cgi	22 Mar 2011 06:00:54 -0000	1.107
@@ -14,6 +14,7 @@
 >
 
 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
+<INPUT TYPE="hidden" NAME="prospectnum" VALUE="<% $prospectnum %>">
 
 % if ( $custnum ) { 
   Customer #<B><% $cust_main->display_custnum %></B> - 
@@ -187,6 +188,7 @@
                  'popnum'          => $popnum,
                  'saved_domsvc'    => $saved_domsvc,
                  %svc_phone,
+                 %svc_dsl,
               )
     %>
 
@@ -237,6 +239,8 @@
 my $pkgpart_svcpart = ''; #first_pkg
 my($username, $password, $popnum, $saved_domsvc) = ( '', '', 0, 0 ); #svc_acct
 my %svc_phone = ();
+my %svc_dsl = ();
+my $prospectnum = '';
 
 if ( $cgi->param('error') ) {
 
@@ -273,6 +277,10 @@
   $svc_phone{$_} = $cgi->param($_)
     foreach qw( countrycode phonenum sip_password pin phone_name );
 
+  #svc_dsl (phonenum came in with svc_phone)
+  $svc_phone{$_} = $cgi->param($_)
+    foreach qw( password isp_chg isp_prev vendor_qual_id );
+
 } elsif ( $cgi->keywords ) { #editing
 
   die "access denied"
@@ -309,6 +317,44 @@
   $stateid = '';
   $payinfo = '';
 
+  if ( $cgi->param('qualnum') =~ /^(\d+)$/ ) {
+    my $qualnum = $1;
+    my $qual = qsearchs('qual', { 'qualnum' => $qualnum } )
+      or die "unknown qualnum $qualnum";
+
+    my $prospect_main = $qual->cust_or_prospect;
+    $prospectnum = $prospect_main->prospectnum
+      or die "qualification not on a prospect";
+
+    $cust_main->agentnum( $prospect_main->agentnum );
+    $cust_main->company(  $prospect_main->company  );
+
+    #first contact? -> name
+    my @contacts = $prospect_main->contact;
+    my $contact = $contacts[0];
+    $cust_main->first( $contact->first );
+    $cust_main->set( 'last', $contact->get('last') );
+    #XXX contact phone numbers
+
+    #XXX additional/all contacts -> alas (notes for now?  add add'l contact support?)
+
+    #XXX move all contacts and locations
+
+    #location -> address  (all prospect quals have location, right?)
+    my $cust_location = $qual->cust_location;
+    $cust_location->dealternize;
+    $cust_main->$_( $cust_location->$_ )
+      foreach qw( address1 address2 city county state zip country geocode );
+
+    #pkgpart handled by lock_pkgpart below
+
+    #XXX locationnum -> package order
+
+    #service telephone & vendor_qual_id -> svc_dsl
+    $svc_dsl{$_} = $qual->$_
+      foreach qw( phonenum vendor_qual_id );
+  }
+
   if ( $cgi->param('lock_pkgpart') =~ /^(\d+)$/ ) {
     my $pkgpart = $1;
     my $part_pkg = qsearchs('part_pkg', { 'pkgpart' => $pkgpart } )



More information about the freeside-commits mailing list