projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
24d75c7
)
fix "Customer has automatic payment information" condition when migrated from v3
author
Ivan Kohler
<ivan@freeside.biz>
Sat, 4 Jun 2016 00:22:33 +0000
(17:22 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Sat, 4 Jun 2016 00:22:33 +0000
(17:22 -0700)
FS/FS/part_event/Condition/has_cust_payby_auto.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_event/Condition/has_cust_payby_auto.pm
b/FS/FS/part_event/Condition/has_cust_payby_auto.pm
index
9f91429
..
42f6d35
100644
(file)
--- a/
FS/FS/part_event/Condition/has_cust_payby_auto.pm
+++ b/
FS/FS/part_event/Condition/has_cust_payby_auto.pm
@@
-30,11
+30,24
@@
sub condition {
my $cust_main = $self->cust_main($object);
my $cust_main = $self->cust_main($object);
+ #handle multiple (HASH) type options migrated from a v3 payby.pm condition
+ # (and maybe we should be a select-multiple or checkbox-multiple too?)
+ my @payby = ();
+ my $payby = $self->option('payby');
+ if ( ref($payby) ) {
+ @payby = keys %$payby;
+ } elsif ( $payby ) {
+ @payby = ( $payby );
+ }
+
scalar( qsearch({
'table' => 'cust_payby',
'hashref' => { 'custnum' => $cust_main->custnum,
scalar( qsearch({
'table' => 'cust_payby',
'hashref' => { 'custnum' => $cust_main->custnum,
- 'payby' => $self->option('payby')
+
#
'payby' => $self->option('payby')
},
},
+ 'extra_sql' => 'AND payby IN ( '.
+ join(',', map dbh->quote($_), @payby).
+ ' ) ',
'order_by' => 'LIMIT 1',
}) );
'order_by' => 'LIMIT 1',
}) );