per-package option to adjust bill date on unsuspend, RT#8434
[freeside.git] / httemplate / edit / cust_main.cgi
index 5751314..30851ca 100755 (executable)
   <% include('cust_main/birthdate.html', $cust_main) %>
 % }
 
+%# latitude and longitude
+% if ( $conf->exists('cust_main-require_censustract') ) {
+%   my ($latitude, $longitude) = $cust_main->service_coordinates;
+%   $latitude ||= $conf->config('company_latitude') || '';
+%   $longitude ||= $conf->config('company_longitude') || '';
+  <INPUT NAME="latitude" TYPE="hidden" VALUE="<% $latitude |h %>">
+  <INPUT NAME="longitude" TYPE="hidden" VALUE="<% $longitude |h %>">
+% }
+
 %# contact info
 
 %  my $same_checked = '';
@@ -47,7 +56,7 @@
 %    }
 %  }
 
-<BR><BR>
+<BR>
 <FONT SIZE="+1"><B>Billing address</B></FONT>
 
 <% include('cust_main/contact.html',
@@ -160,6 +169,8 @@ function samechanged(what) {
 
     <% include('cust_main/first_pkg.html', $cust_main,
                  'pkgpart_svcpart' => $pkgpart_svcpart,
+                 'disable_empty'   =>
+                   scalar( $cgi->param('lock_pkgpart') =~ /^(\d+)$/ ),
                  #svc_acct
                  'username'        => $username,
                  'password'        => $password,
@@ -173,6 +184,7 @@ function samechanged(what) {
 
 <INPUT TYPE="hidden" NAME="otaker" VALUE="<% $cust_main->otaker %>">
 
+%# cust_main/bottomfixup.js
 % foreach my $hidden (
 %    'payauto',
 %    'payinfo', 'payinfo1', 'payinfo2', 'paytype',
@@ -287,11 +299,18 @@ if ( $cgi->param('error') ) {
   $stateid = '';
   $payinfo = '';
 
+  if ( $cgi->param('lock_pkgpart') =~ /^(\d+)$/ ) {
+    my $pkgpart = $1;
+    my $part_pkg = qsearchs('part_pkg', { 'pkgpart' => $pkgpart } )
+      or die "unknown pkgpart $pkgpart";
+    my $svcpart = $part_pkg->svcpart;
+    $pkgpart_svcpart = $pkgpart.'_'.$svcpart;
+  }
+
 }
 
-my $error = $cgi->param('error');
-$cgi->delete_all();
-$cgi->param('error', $error);
+my %keep = map { $_=>1 } qw( error tagnum lock_agentnum lock_pkgpart );
+$cgi->delete( grep !$keep{$_}, $cgi->param );
 
 my $action = $custnum ? 'Edit' : 'Add';
 $action .= ": ". $cust_main->name if $custnum;