diff options
author | Ivan Kohler <ivan@freeside.biz> | 2014-01-15 16:06:00 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2014-01-15 16:06:00 -0800 |
commit | 964f0dc15597f3abb58a0135ec6c44ed8d022365 (patch) | |
tree | 3d78b478de75ae5713bef9ac139e8cf55275460b | |
parent | 11171a2f45def9e2edc48d8e5c545a5005ed6bd0 (diff) |
add customer class event condition, RT#26997
-rw-r--r-- | FS/FS/part_event/Condition/cust_class.pm | 29 |
1 files changed, 29 insertions, 0 deletions
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; |