1 package FS::part_event::Condition::signupdate_age;
2 use base qw( FS::part_event::Condition );
6 sub description { 'Customer signup age'; }
8 #lots of falze laziness w/cust_bill_age, basically just swapped out the field
12 'age' => { label=>'Age', type=>'freq', },
17 my( $self, $cust_bill, %opt ) = @_;
19 my $age = $self->option_age_from('age', $opt{'time'} );
21 my $cust_main = $cust_bill->cust_main;
22 ( $cust_main->signupdate - 60 ) <= $age;
27 my( $class, $table, %opt ) = @_;
29 my $age = $class->condition_sql_option_age_from('age', $opt{'time'} );
31 "( cust_main.signupdate - 60 ) <= $age";
34 # i don't think it really matters what order, since we're a customer condition?
35 # this is for ordering different events for a customer
37 shift->condition_sql_option_age('age');
40 sub order_sql_weight {