[freeside-commits] freeside/httemplate/edit/cust_main birthdate.html, NONE, 1.1 top_misc.html, NONE, 1.1 first_pkg.html, NONE, 1.1 bottomfixup.js, NONE, 1.1 bottomfixup.html, NONE, 1.1 billing.html, 1.23, 1.24 select-domain.html, 1.2, NONE choose_tax_location.html, 1.3, 1.4

Ivan,,, ivan at wavetail.420.am
Sat Apr 11 23:09:14 PDT 2009


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

Modified Files:
	billing.html choose_tax_location.html 
Added Files:
	birthdate.html top_misc.html first_pkg.html bottomfixup.js 
	bottomfixup.html 
Removed Files:
	select-domain.html 
Log Message:
add svc_phone on new customer first package, RT#4315

--- NEW FILE: top_misc.html ---
<% &ntable("#cccccc") %>

%# agent
<% include('/elements/tr-select-agent.html', 
              'curr_value'    => $cust_main->agentnum,
              'label'         => "<B>${r}Agent</B>",
              'empty_label'   => 'Select agent',
              'disable_empty' => ( $cust_main->agentnum ? 1 : 0 ),
           )
%>

%# agent_custid
% if ( $conf->exists('cust_main-edit_agent_custid') ) {

    <TR>
      <TD ALIGN="right">Customer identifier</TD>
      <TD><INPUT TYPE="text" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>"></TD>
    </TR>

% } else {

    <INPUT TYPE="hidden" NAME="agent_custid" VALUE="<% $cust_main->agent_custid %>">

% }

%# referral (advertising source)
%my $refnum = $cust_main->refnum || $conf->config('referraldefault') || 0;
%if ( $custnum && ! $conf->exists('editreferrals') ) {

  <INPUT TYPE="hidden" NAME="refnum" VALUE="<% $refnum %>">

% } else { 

   <% include('/elements/tr-select-part_referral.html',
                'curr_value' => $refnum
             )
   %>
% } 


%# referring customer
%my $referring_cust_main = '';
%if ( $cust_main->referral_custnum
%     and $referring_cust_main =
%           qsearchs('cust_main', { custnum => $cust_main->referral_custnum } )
%) {

  <TR>
    <TD ALIGN="right">Referring customer</TD>
    <TD>
      <A HREF="<% popurl(1) %>/cust_main.cgi?<% $cust_main->referral_custnum %>"><% $cust_main->referral_custnum %>: <% $referring_cust_main->name %></A>
    </TD>
  </TR>
  <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="<% $cust_main->referral_custnum %>">
% } elsif ( ! $conf->exists('disable_customer_referrals') ) { 


  <TR>
    <TD ALIGN="right">Referring customer</TD>
    <TD>
      <!-- <INPUT TYPE="text" NAME="referral_custnum" VALUE=""> -->
      <% include('/elements/search-cust_main.html',
                    'field_name' => 'referral_custnum',
                 )
      %>
    </TD>
  </TR>
% } else { 


  <INPUT TYPE="hidden" NAME="referral_custnum" VALUE="">
% } 


</TABLE>

<%init>

my( $cust_main, %opt ) = @_;

my $custnum = $opt{'custnum'};

my $conf = new FS::Conf;

my $r = qq!<font color="#ff0000">*</font>&nbsp;!;

</%init>

--- NEW FILE: bottomfixup.js ---
function bottomfixup(what) {

  var layervars = new Array(
    'payauto',
    'payinfo', 'payinfo1', 'payinfo2', 'paytype',
    'payname', 'paystate', 'exp_month', 'exp_year', 'paycvv',
    'paystart_month', 'paystart_year', 'payissue',
    'payip',
    'paid'
  );

  var cf = document.CustomerForm;
  var payby = cf.payby.options[cf.payby.selectedIndex].value;
  for ( f=0; f < layervars.length; f++ ) {
    var field = layervars[f];
    copyelement( cf.elements[payby + '_' + field],
                 cf.elements[field]
               );
  }

  //this part does USPS address correction

  // XXX should this be first and should we update the form fields that are
  // displayed???

  var cf = document.CustomerForm;

  var state_el      = cf.elements['state'];
  var ship_state_el = cf.elements['ship_state'];

  //address_standardize(
  var cust_main = new Array(
    'company',  cf.elements['company'].value,
    'address1', cf.elements['address1'].value,
    'address2', cf.elements['address2'].value,
    'city',     cf.elements['city'].value,
    'state',    state_el.options[ state_el.selectedIndex ].value,
    'zip',      cf.elements['zip'].value,

    'ship_company',  cf.elements['ship_company'].value,
    'ship_address1', cf.elements['ship_address1'].value,
    'ship_address2', cf.elements['ship_address2'].value,
    'ship_city',     cf.elements['ship_city'].value,
    'ship_state',    ship_state_el.options[ ship_state_el.selectedIndex ].value,
    'ship_zip',      cf.elements['ship_zip'].value
  );

  address_standardize( cust_main, update_address );

}

var standardize_address;

function update_address(arg) {

  var argsHash = eval('(' + arg + ')');

  var changed  = argsHash['address_standardized'];
  var ship_changed = argsHash['ship_address_standardized'];
  var error = argsHash['error'];
  var ship_error = argsHash['ship_error'];

  //yay closures
  standardize_address = function () {

    var cf = document.CustomerForm;
    var state_el      = cf.elements['state'];
    var ship_state_el = cf.elements['ship_state'];

    if ( changed ) {
      cf.elements['company'].value  = argsHash['new_company'];
      cf.elements['address1'].value = argsHash['new_address1'];
      cf.elements['address2'].value = argsHash['new_address2'];
      cf.elements['city'].value     = argsHash['new_city'];
      setselect(cf.elements['state'], argsHash['new_state']);
      cf.elements['zip'].value      = argsHash['new_zip'];
    }

    if ( ship_changed ) {
      cf.elements['ship_company'].value  = argsHash['new_ship_company'];
      cf.elements['ship_address1'].value = argsHash['new_ship_address1'];
      cf.elements['ship_address2'].value = argsHash['new_ship_address2'];
      cf.elements['ship_city'].value     = argsHash['new_ship_city'];
      setselect(cf.elements['ship_state'], argsHash['new_ship_state']);
      cf.elements['ship_zip'].value      = argsHash['new_ship_zip'];
    }

  }

  var cf = document.CustomerForm;

% if ( $conf->exists('enable_taxproducts') ) {

  if ( <% $taxpre %>error ) {

    var country_el = cf.elements['<% $taxpre %>country'];
    var country = country_el.options[ country_el.selectedIndex ].value;

    if ( country == 'CA' || country == 'US' ) {

      var state_el = cf.elements['<% $taxpre %>state'];
      var state = state_el.options[ state_el.selectedIndex ].value;

      var url = "cust_main/choose_tax_location.html" +
                  "?data_vendor=cch-zip" + 
                  ";city="    + cf.elements['<% $taxpre %>city'].value +
                  ";state="   + state + 
                  ";zip="     + cf.elements['<% $taxpre %>zip'].value +
                  ";country=" + country +
                  ";";

      // popup a chooser
      OLgetAJAX( url, update_geocode, 300 );

    } else {

      cf.elements['geocode'].value = 'DEFAULT';
      cf.submit();

    }

  } else

% }

  if ( changed || ship_changed ) {

%   if ( $conf->exists('cust_main-auto_standardize_address') ) {

    standardize_address();
    cf.submit();

%   } else {

    // popup a confirmation popup

    var confirm_change =
      '<CENTER><BR><B>Confirm address standardization</B><BR><BR>' +
      '<TABLE>';
    
    if ( changed ) {

      confirm_change = confirm_change + 
        '<TR><TH>Entered billing address</TH>' +
          '<TH>Standardized billing address</TH></TR>';
        // + '<TR><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>';
      
      if ( argsHash['company'] || argsHash['new_company'] ) {
        confirm_change = confirm_change +
        '<TR><TD>' + argsHash['company'] +
          '</TD><TD>' + argsHash['new_company'] + '</TD></TR>';
      }
      
      confirm_change = confirm_change +
        '<TR><TD>' + argsHash['address1'] +
          '</TD><TD>' + argsHash['new_address1'] + '</TD></TR>' +
        '<TR><TD>' + argsHash['address2'] +
          '</TD><TD>' + argsHash['new_address2'] + '</TD></TR>' +
        '<TR><TD>' + argsHash['city'] + ', ' + argsHash['state'] + '  ' + argsHash['zip'] +
          '</TD><TD>' + argsHash['new_city'] + ', ' + argsHash['new_state'] + '  ' + argsHash['new_zip'] + '</TD></TR>' +
          '<TR><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>';

    }

    if ( ship_changed ) {

      confirm_change = confirm_change + 
        '<TR><TH>Entered service address</TH>' +
          '<TH>Standardized service address</TH></TR>';
        // + '<TR><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>';
      
      if ( argsHash['ship_company'] || argsHash['new_ship_company'] ) {
        confirm_change = confirm_change +
        '<TR><TD>' + argsHash['ship_company'] +
          '</TD><TD>' + argsHash['new_ship_company'] + '</TD></TR>';
      }
      
      confirm_change = confirm_change +
        '<TR><TD>' + argsHash['ship_address1'] +
          '</TD><TD>' + argsHash['new_ship_address1'] + '</TD></TR>' +
        '<TR><TD>' + argsHash['ship_address2'] +
          '</TD><TD>' + argsHash['new_ship_address2'] + '</TD></TR>' +
        '<TR><TD>' + argsHash['ship_city'] + ', ' + argsHash['ship_state'] + '  ' + argsHash['ship_zip'] +
          '</TD><TD>' + argsHash['new_ship_city'] + ', ' + argsHash['new_ship_state'] + '  ' + argsHash['new_ship_zip'] + '</TD></TR>' +
        '<TR><TD>&nbsp;</TD><TD>&nbsp;</TD></TR>';

    }

    var addresses = 'address';
    var height = 268;
    if ( changed && ship_changed ) {
      addresses = 'addresses';
      height = 396; // #what
    }

    confirm_change = confirm_change +
      '<TR><TD>' +
        '<BUTTON TYPE="button" onClick="document.CustomerForm.submit();"><IMG SRC="<%$p%>images/error.png" ALT=""> Use entered ' + addresses + '</BUTTON>' + 
      '</TD><TD>' +
        '<BUTTON TYPE="button" onClick="standardize_address(); document.CustomerForm.submit();"><IMG SRC="<%$p%>images/tick.png" ALT=""> Use standardized ' + addresses + '</BUTTON>' + 
      '</TD></TR>' +
      '<TR><TD COLSPAN=2 ALIGN="center">' +
        '<BUTTON TYPE="button" onClick="document.CustomerForm.submitButton.disabled=false; parent.cClick();"><IMG SRC="<%$p%>images/cross.png" ALT=""> Cancel submission</BUTTON></TD></TR>' +
        
      '</TABLE></CENTER>';

    overlib( confirm_change, CAPTION, 'Confirm address standardization', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, height, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 );

%   }

  } else {

    cf.submit();

  }

}

function update_geocode() {

  //yay closures
  set_geocode = function (what) {

    var cf = document.CustomerForm;

    //alert(what.options[what.selectedIndex].value);
    var argsHash = eval('(' + what.options[what.selectedIndex].value + ')');
    cf.elements['<% $taxpre %>city'].value     = argsHash['city'];
    setselect(cf.elements['<% $taxpre %>state'], argsHash['state']);
    cf.elements['<% $taxpre %>zip'].value      = argsHash['zip'];
    cf.elements['geocode'].value  = argsHash['geocode'];

  }

  // popup a chooser

  overlib( OLresponseAJAX, CAPTION, 'Select tax location', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 );

}

function copyelement(from, to) {
  if ( from == undefined ) {
    to.value = '';
  } else if ( from.type == 'select-one' ) {
    to.value = from.options[from.selectedIndex].value;
    //alert(from + " (" + from.type + "): " + to.name + " => (" + from.selectedIndex + ") " + to.value);
  } else if ( from.type == 'checkbox' ) {
    if ( from.checked ) {
      to.value = from.value;
    } else {
      to.value = '';
    }
  } else {
    if ( from.value == undefined ) {
      to.value = '';
    } else {
      to.value = from.value;
    }
  }
  //alert(from + " (" + from.type + "): " + to.name + " => " + to.value);
}

function setselect(el, value) {

  for ( var s = 0; s < el.options.length; s++ ) {
     if ( el.options[s].value == value ) {
       el.selectedIndex = s;
     }
  }

}
<%init>

my $conf = new FS::Conf;

my $taxpre = $conf->exists('tax-ship_address') ? 'ship_' : '';

</%init>

--- NEW FILE: birthdate.html ---
<% ntable("#cccccc", 2) %>
  <% include ('/elements/tr-input-date-field.html',
              'birthdate',
              $cust_main->birthdate,
              'Date of Birth',
              $conf->config('date_format') || "%m/%d/%Y",
              1)
  %>
</TABLE>
<%init>

my( $cust_main, %opt ) = @_;
my $conf = new FS::Conf;

</%init>

--- NEW FILE: first_pkg.html ---
% if ( @part_pkg ) {

    <BR><BR>
    <FONT SIZE="+1"><B>First package</B></FONT>
    <% ntable("#cccccc") %>

      <TR>
        <TD COLSPAN=2>
          <% include('first_pkg/select-part_pkg.html',
                       'part_pkg' => \@part_pkg,
                       %opt,
                       # map { $_ => $opt{$_} } qw( pkgpart_svcpart saved_domsvc )
                    )
          %>

% } 
<%init>

my( $cust_main, %opt ) = @_;

# pry the wrong place for this logic.  also pretty expensive

#false laziness, copied from FS::cust_pkg::order
my $pkgpart;
my $agentnum = '';
my @agents = $FS::CurrentUser::CurrentUser->agents;
if ( scalar(@agents) == 1 ) {
  # $pkgpart->{PKGPART} is true iff $custnum may purchase PKGPART
  $pkgpart = $agents[0]->pkgpart_hashref;
  $agentnum = $agents[0]->agentnum;
} else {
  #can't know (agent not chosen), so, allow all
  $agentnum = 'all';
  my %typenum;
  foreach my $agent ( @agents ) {
    next if $typenum{$agent->typenum}++;
    $pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref }
  }
}
#eslaf

my @first_svc = ( 'svc_acct', 'svc_phone' );

my @part_pkg =
  grep { $_->svcpart(\@first_svc)
         && ( $pkgpart->{ $_->pkgpart } 
              || $agentnum eq 'all'
              || ( $agentnum ne 'all' && $agentnum && $_->agentnum
                   && $_->agentnum == $agentnum
                 )
            )
       }
  qsearch( 'part_pkg', { 'disabled' => '' }, '', 'ORDER BY pkg' ); # case?

</%init>

Index: billing.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main/billing.html,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- billing.html	2 Apr 2009 20:22:32 -0000	1.23
+++ billing.html	12 Apr 2009 06:09:12 -0000	1.24
@@ -1,18 +1,15 @@
 %if ( $payby_default eq 'HIDE' ) {
 %
 %  $cust_main->payby('BILL') unless $cust_main->payby;
+%  my $payby = $cust_main->payby;
 
-  <INPUT TYPE="hidden" NAME="select" VALUE="<% $cust_main->payby %>">
-
-  </FORM>
-
-  <FORM NAME="<% $cust_main->payby %>" STYLE="margin-top: 0; margin-bottom: 0"> 
+  <INPUT TYPE="hidden" NAME="payby" VALUE="<% $payby %>">
 
-    <INPUT TYPE="hidden" NAME="payinfo" VALUE="<% $cust_main->paymask %>">
+  <INPUT TYPE="hidden" NAME="<%$payby%>_payinfo" VALUE="<% $cust_main->paymask %>">
 
 % foreach my $field (qw( payname paycvv paystart_month paystart_year payissue payip paytype paystate )) { 
 
-    <INPUT TYPE="hidden" NAME="<% $field %>" VALUE="<% $cust_main->getfield($field) %>">
+    <INPUT TYPE="hidden" NAME="<% $payby.'_'.$field %>" VALUE="<% $cust_main->get($field) %>">
 
 % } 
 
@@ -27,24 +24,18 @@
 %    die "unrecognized expiration date format: $date";
 %  }
 
-  <INPUT TYPE="hidden" NAME="exp_month" VALUE="<% $mon %>">
-  <INPUT TYPE="hidden" NAME="exp_year"  VALUE="<% $year %>">
-
-  </FORM>
-
-  <FORM NAME="billing_bottomform" STYLE="margin-top: 0; margin-bottom: 0">
+  <INPUT TYPE="hidden" NAME="<%$payby%>_exp_month" VALUE="<% $mon %>">
+  <INPUT TYPE="hidden" NAME="<%$payby%>_exp_year"  VALUE="<% $year %>">
 
   <INPUT TYPE="hidden" NAME="tax" VALUE="<% $cust_main->tax %>">
 
   <INPUT TYPE="hidden" NAME="invoicing_list" VALUE="<% join(', ', @invoicing_list) %>">
 
-  </FORM>
-
 % } else {
 %
 %  my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
 
-  <BR>Billing information
+  <BR><FONT SIZE="+1"><B>Billing information</B></FONT>
   <% &ntable("#cccccc") %>
 
     <TR>
@@ -128,13 +119,13 @@
 %      '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Card number </TD>!.
-%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $payinfo : '' ). qq!" MAXLENGTH=19 onChange="card_changed(this)" onKeyUp="card_changed(this)"></TD></TR>!.
+%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="CARD_payinfo" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $payinfo : '' ). qq!" MAXLENGTH=19 onChange="card_changed(this)" onKeyUp="card_changed(this)"></TD></TR>!.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Expiration </TD>!.
 %          '<TD WIDTH="408">'.
 %
 %          include('/elements/select-month_year.html',
-%                    'prefix' => 'exp',
+%                    'prefix' => 'CARD_exp',
 %                    'selected_date' =>
 %                      ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->paydate : '' ),
 %                 ).
@@ -145,14 +136,14 @@
 %
 %          qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/cvv2.html', 480, 352, 'cvv2_popup' ), CAPTION, 'CVV2 Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)!.
 %          qq!</TD>!.
-%          '<TD WIDTH="408"><INPUT TYPE="text" NAME="paycvv" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ && !$cust_main->is_encrypted($cust_main->paycvv) ? $cust_main->paycvv : '' ). '" SIZE=4 MAXLENGTH=4>'.
+%          '<TD WIDTH="408"><INPUT TYPE="text" NAME="CARD_paycvv" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ && !$cust_main->is_encrypted($cust_main->paycvv) ? $cust_main->paycvv : '' ). '" SIZE=4 MAXLENGTH=4>'.
 %
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200"><SPAN ID="paystart_label" $text_disabled>Start date </SPAN></TD>!.
 %          '<TD WIDTH="408">'.
 %
 %          include('/elements/select-month_year.html',
-%                    'prefix' => 'paystart',
+%                    'prefix' => 'CARD_paystart',
 %                    'disabled' => $disabled,
 %                    'empty_option' => 1,
 %                    'start_year' => 2000,
@@ -167,12 +158,12 @@
 %                 ).
 %
 %        qq!<SPAN ID="payissue_label" $text_disabled> or Issue number </SPAN>!.
-%          '<INPUT TYPE="text" NAME="payissue" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->payissue : '' ). qq!" SIZE=3 MAXLENGTH=2 $disabled></TD></TR>!.
+%          '<INPUT TYPE="text" NAME="CARD_payissue" VALUE="'. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->payissue : '' ). qq!" SIZE=3 MAXLENGTH=2 $disabled></TD></TR>!.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Exact name on card </TD>!.
-%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
+%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="CARD_payname" VALUE="!. ( $payby =~ /^(CARD|DCRD)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
 %
-%        qq!<TR><TD COLSPAN=2 WIDTH="608"><INPUT TYPE="checkbox" NAME="payauto" !. ( $payby eq 'DCRD' ? '' : 'CHECKED' ). '> Charge future payments to this card automatically</TD></TR>'.
+%        qq!<TR><TD COLSPAN=2 WIDTH="608"><INPUT TYPE="checkbox" NAME="CARD_payauto" !. ( $payby eq 'DCRD' ? '' : 'CHECKED' ). '> Charge future payments to this card automatically</TD></TR>'.
 %
 %      '</TABLE>',
 %
@@ -181,21 +172,21 @@
 %      '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Account number </TD>!.
-%          qq!<TD><INPUT TYPE="text" SIZE=12 NAME="payinfo1" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $account : '' ). '"></TD>'.
-%          qq!<TD ALIGN="right">Type</TD><TD><SELECT NAME="paytype">!.
+%          qq!<TD><INPUT TYPE="text" SIZE=12 NAME="CHEK_payinfo1" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $account : '' ). '"></TD>'.
+%          qq!<TD ALIGN="right">Type</TD><TD><SELECT NAME="CHEK_paytype">!.
 %            join('', map { qq!<OPTION VALUE="$_" !.($paytype eq $_ ? 'SELECTED' : '').">$_</OPTION>" } @FS::cust_main::paytypes).
 %          qq!</SELECT></TD></TR>!.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}ABA/Routing number </TD>!.
-%          qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="payinfo2" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). qq!" SIZE=10 MAXLENGTH=9> !.
+%          qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="CHEK_payinfo2" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $aba : '' ). qq!" SIZE=10 MAXLENGTH=9> !.
 %          qq!(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)!.
 %          qq!</TD></TR>!.
 %
-%        qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!.
-%        qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
+%        qq!<INPUT TYPE="hidden" NAME="CHEK_exp_month" VALUE="12">!.
+%        qq!<INPUT TYPE="hidden" NAME="CHEK_exp_year" VALUE="2037">!.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Bank name </TD>!.
-%          qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
+%          qq!<TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" NAME="CHEK_payname" VALUE="!. ( $payby =~ /^(CHEK|DCHK)$/ ? $cust_main->payname : '' ). qq!"></TD></TR>!.
 %      ( $conf->exists('show_bankstate') ?
 %          qq!<TR><TD ALIGN="right" WIDTH="200">$paystate_label</TD>!.
 %          qq!<TD COLSPAN="3" WIDTH="408">!.
@@ -203,14 +194,14 @@
 %                    'empty'   => '(choose)',
 %                    'state'   => $cust_main->paystate,
 %                    'country' => $cust_main->country,
-%                    'prefix'  => 'pay',
+%                    'prefix'  => 'CHEK_pay',
 %                 ). "</TD></TR>"
-%         : '<INPUT TYPE="hidden" NAME="paystate" VALUE="'.
+%         : '<INPUT TYPE="hidden" NAME="CHEK_paystate" VALUE="'.
 %            $cust_main->paystate. '">'
 %       ).
 %
 %
-%        qq!<TR><TD COLSPAN=4 WIDTH="608"><INPUT TYPE="checkbox" NAME="payauto" !. ( $payby eq 'DCHK' ? '' : 'CHECKED' ). '> Charge future payments to this electronic check automatically</TD></TR>'.
+%        qq!<TR><TD COLSPAN=4 WIDTH="608"><INPUT TYPE="checkbox" NAME="CHEK_payauto" !. ( $payby eq 'DCHK' ? '' : 'CHECKED' ). '> Charge future payments to this electronic check automatically</TD></TR>'.
 %
 %        '<TR><TD>&nbsp;</TD></TR>'.
 %        '<TR><TD>&nbsp;</TD></TR>'.
@@ -223,11 +214,11 @@
 %      '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Phone number </TD>!.
-%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'LECB' ? $cust_main->payinfo : '' ). qq!" MAXLENGTH=15 SIZE=16></TD></TR>!.
+%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="LECB_payinfo" VALUE="!. ( $payby eq 'LECB' ? $cust_main->payinfo : '' ). qq!" MAXLENGTH=15 SIZE=16></TD></TR>!.
 %
-%        qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!.
-%        qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
-%        qq!<INPUT TYPE="hidden" NAME="payname" VALUE="">!.
+%        qq!<INPUT TYPE="hidden" NAME="LECB_exp_month" VALUE="12">!.
+%        qq!<INPUT TYPE="hidden" NAME="LECB_exp_year" VALUE="2037">!.
+%        qq!<INPUT TYPE="hidden" NAME="LECB_payname" VALUE="">!.
 %
 %        '<TR><TD>&nbsp;</TD></TR>'.
 %        '<TR><TD>&nbsp;</TD></TR>'.
@@ -243,13 +234,13 @@
 %      '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">P.O. </TD>!.
-%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE="!. ( $payby eq 'BILL' ? $cust_main->payinfo : '' ). qq!"></TD></TR>!.
+%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="BILL_payinfo" VALUE="!. ( $payby eq 'BILL' ? $cust_main->payinfo : '' ). qq!"></TD></TR>!.
 %
-%        qq!<INPUT TYPE="hidden" NAME="exp_month" VALUE="12">!.
-%        qq!<INPUT TYPE="hidden" NAME="exp_year" VALUE="2037">!.
+%        qq!<INPUT TYPE="hidden" NAME="BILL_exp_month" VALUE="12">!.
+%        qq!<INPUT TYPE="hidden" NAME="BILL_exp_year" VALUE="2037">!.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">Attention </TD>!.
-%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payname" VALUE="!. ( $payby eq 'BILL' ? $cust_main->payname : '' ). qq!"></TD></TR>!.
+%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="BILL_payname" VALUE="!. ( $payby eq 'BILL' ? $cust_main->payname : '' ). qq!"></TD></TR>!.
 %
 %        '<TR><TD>&nbsp;</TD></TR>'.
 %        '<TR><TD>&nbsp;</TD></TR>'.
@@ -264,13 +255,13 @@
 %      '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Approved by </TD>!.
-%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="payinfo" VALUE=""></TD></TR>!.
+%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""></TD></TR>!.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Expiration </TD>!.
 %          '<TD WIDTH="408">'.
 %
 %          include('/elements/select-month_year.html',
-%                    'prefix' => 'exp',
+%                    'prefix' => 'COMP_exp',
 %                    'selected_date' =>
 %                      ( $payby eq 'COMP' ? $cust_main->paydate : '' ),
 %                 ).
@@ -290,7 +281,7 @@
 %      '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!.
-%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'CASH' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
+%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="CASH_paid" VALUE="!. ( $payby eq 'CASH' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
 %
 %        '<TR><TD>&nbsp;</TD></TR>'.
 %        '<TR><TD>&nbsp;</TD></TR>'.
@@ -306,7 +297,7 @@
 %      '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!.
-%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'WEST' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
+%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="WEST_paid" VALUE="!. ( $payby eq 'WEST' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
 %
 %        '<TR><TD>&nbsp;</TD></TR>'.
 %        '<TR><TD>&nbsp;</TD></TR>'.
@@ -322,7 +313,7 @@
 %      '<TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192>'.
 %
 %        qq!<TR><TD ALIGN="right" WIDTH="200">${r}Amount </TD>!.
-%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="paid" VALUE="!. ( $payby eq 'MCRD' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
+%          qq!<TD WIDTH="408"><INPUT TYPE="text" NAME="MCRD_paid" VALUE="!. ( $payby eq 'MCRD' ? $cust_main->paid : '' ). qq!"></TD></TR>!.
 %
 %        '<TR><TD>&nbsp;</TD></TR>'.
 %        '<TR><TD>&nbsp;</TD></TR>'.
@@ -336,48 +327,33 @@
 %  );
 %
 %  #this should use FS::payby
-%  my %allopt = (
-%    'CARD' => 'Credit card',
-%    'CHEK' => 'Electronic check',
-%    'LECB' => 'Phone bill billing',
-%    'BILL' => 'Billing',
-%    'CASH' => 'Cash', # initial payment, then billing',
-%    'WEST' => 'Western Union', # initial payment, then billing',
-%    'MCRD' => 'Manual credit card', # initial payment, then billing',
-%    'COMP' => 'Complimentary',
-%  );
-%  if ( $cust_main->custnum ) { #don't offer CASH/WEST/MCRD initial payment types
-%                               # when editing customer
+%  my @allopt = qw( CARD CHEK LECB BILL CASH WEST MCRD COMP );
+%
+%  my %allopt = map { $_ => FS::payby->shortname($_) } @allopt;
+%
+%  if ( $cust_main->custnum ) {
+%    #don't offer CASH/WEST/MCRD initial payment types when editing customer
 %    delete $allopt{$_} for qw(CASH WEST MCRD);
 %  }
 %  
-%  tie my %options, 'Tie::IxHash',
-%    map  { $_ => $allopt{$_} }
-%    grep { exists $allopt{$_} }
-%         @payby;
+%  my @options = grep exists( $allopt{$_} ), @payby;
 %
 %  my %payby2option = (
-%    ( map { $_ => $_ } keys %options ),
+%    ( map { $_ => $_ } @options ),
 %    'DCRD' => 'CARD',
 %    'DCHK' => 'CHEK',
 %  );
-%
-%  my $widget = new HTML::Widgets::SelectLayers(
-%    'options'        => \%options,
-%    #'form_name'      => 'dummy',
-%    #'form_action'    => 'nothingyet',
-%    #chops bottom of page in IE# 'under_position' => 'absolute',
-%    'html_between'   => '</TD></TR></TABLE>',
-%    'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] },
-%    'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
-%  );
-%
-%  
 
-
-  <TD WIDTH="408"><% $widget->html %>
-
-  <FORM NAME="billing_bottomform" STYLE="margin-top: 0; margin-bottom: 0">
+  <TD WIDTH="408">
+    <% include( '/elements/selectlayers.html',
+                  'field'      => 'payby',
+                  'curr_value' => $payby2option{$payby || $payby_default || $payby[0] },
+                  'options'    => \@options,
+                  'labels'     => \%allopt,
+                  'html_between' => '</TD></TR></TABLE>',
+                  'layer_callback' => sub { my $layer = shift; $payby{$layer}; },
+              )
+    %>
 
   <% &ntable("#cccccc") %>
 
@@ -457,8 +433,6 @@
 
   </TABLE>
 
-  </FORM>
-
   <% $r %> required fields
 % } 
 

Index: choose_tax_location.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main/choose_tax_location.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- choose_tax_location.html	19 Feb 2009 13:38:28 -0000	1.3
+++ choose_tax_location.html	12 Apr 2009 06:09:12 -0000	1.4
@@ -26,8 +26,8 @@
 </SELECT><BR><BR>
 
 <TABLE><TR>
-  <TD> <BUTTON TYPE="button" onClick="set_geocode(document.getElementById('geocodes')); document.bottomform.submit();"><IMG SRC="<%$p%>images/tick.png" ALT=""> Set location </BUTTON></TD>
-  <TD><BUTTON TYPE="button" onClick="document.bottomform.submitButton.disabled=false; parent.cClick();"><IMG SRC="<%$p%>images/cross.png" ALT=""> Cancel submission </BUTTON></TD>
+  <TD> <BUTTON TYPE="button" onClick="set_geocode(document.getElementById('geocodes')); document.CustomerForm.submit();"><IMG SRC="<%$p%>images/tick.png" ALT=""> Set location </BUTTON></TD>
+  <TD><BUTTON TYPE="button" onClick="document.CustomerForm.submitButton.disabled=false; parent.cClick();"><IMG SRC="<%$p%>images/cross.png" ALT=""> Cancel submission </BUTTON></TD>
 </TR>
 </TABLE>
 

--- select-domain.html DELETED ---

--- NEW FILE: bottomfixup.html ---
<% include('/elements/init_overlib.html') %>

<% include( '/elements/xmlhttp.html',
              'url'  => $p.'misc/xmlhttp-cust_main-address_standardize.html',
              'subs' => [ 'address_standardize' ],
              #'method' => 'POST', #could get too long?
          )
%>

<SCRIPT TYPE="text/javascript">
  <% include('bottomfixup.js') %>
</SCRIPT>



More information about the freeside-commits mailing list