further optimize condition_sql for "Invoice eligible for automatic collection" condit...
[freeside.git] / FS / FS / part_event / Condition / cust_class.pm
1 package FS::part_event::Condition::cust_class;
2 use base qw( FS::part_event::Condition );
3
4 use strict;
5
6 sub description {
7   'Customer class';
8 }
9
10 sub option_fields {
11   (
12     'cust_class'  => { 'label'    => 'Customer Class',
13                        'type'     => 'select-cust_class',
14                        'multiple' => 1,
15                      },
16   );
17 }
18
19 sub condition {
20   my( $self, $object ) = @_;
21
22   my $cust_main = $self->cust_main($object);
23
24   my $hashref = $self->option('cust_class') || {};
25   
26   $hashref->{ $cust_main->classnum };
27 }
28
29 1;