summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-01-15 16:05:35 -0800
committerIvan Kohler <ivan@freeside.biz>2014-01-15 16:05:35 -0800
commitded7dddeaf4ec7ec42b5f59133b487a62f43ea78 (patch)
tree8bf543df3e0e97641b2bda5b5a83cd0b0759f7b5
parent6d4950db273abb64d31570171260f937b61812da (diff)
add customer class event condition, RT#26997
-rw-r--r--FS/FS/part_event/Condition/cust_class.pm29
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;