diff options
Diffstat (limited to 'FS/FS/part_event/Condition/pkg_class.pm')
-rw-r--r-- | FS/FS/part_event/Condition/pkg_class.pm | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/FS/FS/part_event/Condition/pkg_class.pm b/FS/FS/part_event/Condition/pkg_class.pm new file mode 100644 index 0000000..8c9031c --- /dev/null +++ b/FS/FS/part_event/Condition/pkg_class.pm @@ -0,0 +1,38 @@ +package FS::part_event::Condition::pkg_class; + +use strict; + +use base qw( FS::part_event::Condition ); +use FS::Record qw( qsearch ); +use FS::pkg_class; + +sub description { + 'Package Class'; +} + +sub eventtable_hashref { + { 'cust_main' => 0, + 'cust_bill' => 0, + 'cust_pkg' => 1, + }; +} + +#something like this +sub option_fields { + ( + 'pkgclass' => { 'label' => 'Package Class', + 'type' => 'select-pkg_class', + 'multiple' => 1, + }, + ); +} + +sub condition { + my( $self, $cust_pkg ) = @_; + + #XXX test + my $hashref = $self->option('pkgclass') || {}; + $hashref->{ $cust_pkg->part_pkg->classnum }; +} + +1; |