X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fcust_payby.html;fp=httemplate%2Felements%2Fcust_payby.html;h=6765df0778f13fd575e69f0d8e81de6845f685ee;hp=6404bcb33d975635e4dc7c9e639db4d791c0ea44;hb=0d43df4e3b41cbd964d7ca32ac07d9f13a2b0a1d;hpb=67b494b17dc5047f7fdcdb16aa138612b520d42c diff --git a/httemplate/elements/cust_payby.html b/httemplate/elements/cust_payby.html index 6404bcb33..6765df077 100644 --- a/httemplate/elements/cust_payby.html +++ b/httemplate/elements/cust_payby.html @@ -306,8 +306,11 @@ if ( $curr_value ) { $cust_payby = new FS::cust_payby {}; } my $sel_payby = $cgi->param($name.'_payby') || $cust_payby->payby; +# 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 ($sel_payby eq 'DCRD') { +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') {