ID = "<%$id%>_paycvv"
SIZE = 2
MAXLENGTH = 4
- VALUE = "<% scalar($cgi->param($name.'_paycvv')) %>"
+ VALUE = "<% scalar($cgi->param($name.'_paycvv')) || ('*' x length($cust_payby->paycvv)) %>"
onChange = "<% $onchange %>"
>
- <BR><FONT SIZE="-1"><% mt('CVV2') |h %> (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('<%$p%>docs/cvv2.html', 480, 275, 'cvv2_popup' ), CAPTION, 'CVV2 Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;"><% mt('help') |h %></A>)</FONT>
+ <BR><FONT SIZE="-1"><% mt('CVV2') |h %> <& /elements/popup_link.html,
+ 'action' => $p.'docs/cvv2.html',
+ 'label' => mt('(help)'),
+ 'actionlabel' => 'CVV2 Help',
+ 'width' => 480,
+ 'height' => 275,
+ 'nocenter' => 1,
+ #popup_name => 'cvv2_popup',
+ &></FONT>
</TD>
<TD ID="<%$id%>_td_payname" <%$card_display%>>
<& /elements/select-state.html,
'prefix' => $name. '_pay',
'empty' => emt('(choose)'),
- 'state' => $cgi->param($name.'_paystate')
- || $cust_payby->paystate,
+ 'state' => ( scalar($cgi->param($name.'_paystate'))
+ || $cust_payby->paystate ),
#was cust_main->country in 3.x, but this will do until/unlesss
# someone needs to track foreign bank states
- 'country' => scalar($conf->config('countrydefault')) || 'US',
+ 'country' => ( scalar($conf->config('countrydefault')) || 'US' ),
&>
<BR><FONT SIZE="-1"><% mt('Bank state') |h %></FONT>
</TD>
$cust_payby = new FS::cust_payby {};
}
my $sel_payby = $cgi->param($name.'_payby') || $cust_payby->payby;
-$sel_payby = 'CARD' if $sel_payby eq 'DCRD' || $sel_payby eq '';
-$sel_payby = 'CHEK' if $sel_payby eq 'DCHK';
+# add a weight for CARD/CHEK imports, so we don't turn off auto-charge on edit
+# convert DCRD to CARD + no weight, and the same for DCHK/CHEK
+if ( $cust_payby->custpaybynum && $sel_payby =~ /^(CARD|CHEK)$/ && ! $cust_payby->weight ) {
+ $cust_payby->weight(1);
+} elsif ($sel_payby eq 'DCRD') {
+ $sel_payby = 'CARD';
+ $cust_payby->weight('');
+} elsif ($sel_payby eq 'DCHK') {
+ $sel_payby = 'CHEK';
+ $cust_payby->weight('');
+} elsif (!$sel_payby) {
+ # default
+ $sel_payby = 'CARD';
+}
my @payby = FS::payby->cust_payby;
my %conf_payby = map { $_=>1 } $conf->config('payby');