multiple payment options, RT#23741
[freeside.git] / FS / FS / part_event / Condition / hasnt_cust_payby_auto.pm
1 package FS::part_event::Condition::hasnt_cust_payby_auto;
2
3 use strict;
4 use Tie::IxHash;
5
6 use base qw( FS::part_event::Condition );
7
8 sub description {
9   'Customer does not have automatic payment information';
10 }
11
12 sub condition {
13   my( $self, $object ) = @_;
14
15   my $cust_main = $self->cust_main($object);
16
17   ! scalar( qsearch({ 
18     'table'     => 'cust_payby',
19     'hashref'   => { 'custnum' => $cust_main->custnum,
20                    },
21     'extra_sql' => "AND payby IN ( 'CARD', 'CHEK' )",
22     'order_by'  => 'LIMIT 1',
23   }) );
24
25 }
26
27 1;