projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
67b494b
)
don't forget auto-charge on customer edit with data upgraded from v3
author
Ivan Kohler
<ivan@freeside.biz>
Fri, 4 Mar 2022 01:17:14 +0000
(17:17 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Fri, 4 Mar 2022 01:17:14 +0000
(17:17 -0800)
httemplate/elements/cust_payby.html
patch
|
blob
|
history
diff --git
a/httemplate/elements/cust_payby.html
b/httemplate/elements/cust_payby.html
index
6404bcb
..
6765df0
100644
(file)
--- 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;
$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
# 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') {
$sel_payby = 'CARD';
$cust_payby->weight('');
} elsif ($sel_payby eq 'DCHK') {