RT# 74537 - fixes error where paytype is blank in V3
[freeside.git] / fs_selfservice / FS-SelfService / cgi / change_pay.html
index e38ba76..9ed621f 100644 (file)
@@ -14,6 +14,7 @@
 
   my $tail = qq(</TABLE>).
              qq(<INPUT TYPE="hidden" NAME="action" VALUE="process_change_pay">).
+             qq(<INPUT TYPE="hidden" NAME="custpaybynum" VALUE="$custpaybynum">).
              qq(<BR>).
              qq(<INPUT TYPE="submit" NAME="process" ).
              qq(VALUE="Save payment information"> ).
@@ -39,8 +40,8 @@
                     );
 
   ## Don't show CHEK or DCHK option if ACH is read only
-  delete( $payby_index{'CHEK'} ) unless !$ach_read_only;
-  delete( $payby_index{'DCHK'} ) unless !$ach_read_only;
+  delete( $payby_index{'CHEK'} ) if ($ach_read_only && $payby ne "CHEK");
+  delete( $payby_index{'DCHK'} ) if ($ach_read_only && $payby ne "DCHK");
 
   tie my %options, 'Tie::IxHash', ();
   foreach my $payby_option ( grep { exists( $payby_index{$_} ) } @paybys ) {
@@ -60,9 +61,6 @@
   delete $options{'DCRD'} unless $payby eq 'DCRD' || ! exists $options{'CARD'};
   delete $options{'DCHK'} unless $payby eq 'DCHK' || ! exists $options{'CHEK'};
 
-  ## setting payby to default to layer if only one.  should we always display first layer?
-  if (keys %options == 1) { @p = keys %options; $payby = $p[0]; }
-
   HTML::Widgets::SelectLayers->new(
     options => \%options,
     selected_layer => $payby,