From: Ivan Kohler Date: Thu, 16 Jan 2014 00:05:37 +0000 (-0800) Subject: add customer class event condition, RT#26997 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=18430ed0fb606a05154a7ca748d9a2b85d158fb0 add customer class event condition, RT#26997 --- diff --git a/FS/FS/part_event/Condition/cust_class.pm b/FS/FS/part_event/Condition/cust_class.pm new file mode 100644 index 000000000..791bb6378 --- /dev/null +++ b/FS/FS/part_event/Condition/cust_class.pm @@ -0,0 +1,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;