Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / eg / part_event-Condition-template.pm
1 package FS::part_event::Condition::mycondition;
2
3 use strict;
4
5 use base qw( FS::part_event::Condition );
6
7 # see the FS::part_event::Condition manpage for full documentation on each
8 # of the required and optional methods.
9
10 sub description {
11   'New condition (the author forgot to change this description)';
12 }
13
14 #sub eventtable_hashref {
15 #    { 'cust_main'      => 1,
16 #      'cust_bill'      => 1,
17 #      'cust_pkg'       => 1,
18 #      'cust_pay_batch' => 1,
19 #    };
20 #}
21
22 #sub option_fields {
23 #  (
24 #    'field'         => 'description',
25 #
26 #    'another_field' => { 'label'=>'Amount', 'type'=>'money', },
27 #
28 #    'third_field'   => { 'label'         => 'Types',
29 #                         'type'          => 'checkbox-multiple',
30 #                         'options'       => [ 'h', 's' ],
31 #                         'option_labels' => { 'h' => 'Happy',
32 #                                              's' => 'Sad',
33 #                                            },
34 #  );
35 #}
36
37 sub condition {
38   my($self, $object, %opt) = @_;
39
40   my $cust_main = $self->cust_main($object);
41
42   my $value_of_field = $self->option('field');
43
44   my $time = $opt{'time'}; #use this instead of time or $^T
45
46   #test your condition
47   1;
48
49 }
50
51 #sub condition_sql {
52 #  my( $class, $table ) = @_;
53 #  #...
54 #  'true';
55 #}
56
57 1;