1 package FS::part_event::Condition::cust_bill_has_service;
6 use base qw( FS::part_event::Condition );
9 'Invoice is billing for a certain service type';
12 sub eventtable_hashref {
19 # could not find component for path '/elements/tr-select-part_svc.html'
24 'has_service' => { 'label' => 'Has service',
25 'type' => 'select-part_svc',
26 'multiple' => 1, #the HTML element seems to have it
27 #by default, but edit/part_event.html
28 #(and process) need to know
34 #my($self, $cust_bill, %opt) = @_;
35 my($self, $cust_bill) = @_;
37 my $servicenum = $self->option('has_service');
39 grep { $servicenum == $_->svcpart }
45 my( $class, $table, %opt ) = @_;
48 $class->condition_sql_option_integer('has_service', $opt{'driver_name'});
50 my $sql = qq| 0 < ( SELECT COUNT(cs.svcpart)
51 FROM cust_bill_pkg cbp, cust_svc cs
52 WHERE cbp.invnum = cust_bill.invnum
53 AND cs.pkgnum = cbp.pkgnum
54 AND cs.svcpart = $servicenum