summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;