summaryrefslogtreecommitdiff
path: root/FS/FS/part_event/Condition/cust_class.pm
blob: 791bb63780456f757a285d20919b1f000a5a8976 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package FS::part_event::Condition::cust_class;
use base qw( FS::part_event::Condition );

use strict;

sub description {
  'Customer class';
}

sub option_fields {
  (
    'cust_class'  => { 'label'    => 'Customer Class',
                       'type'     => 'select-cust_class',
                       'multiple' => 1,
                     },
  );
}

sub condition {
  my( $self, $object ) = @_;

  my $cust_main = $self->cust_main($object);

  my $hashref = $self->option('cust_class') || {};
  
  $hashref->{ $cust_main->classnum };
}

1;