projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
contacts can be shared among customers / "duplicate contact emails", RT#27943
[freeside.git]
/
FS
/
FS
/
part_event
/
Condition
/
cust_bill_has_service.pm
diff --git
a/FS/FS/part_event/Condition/cust_bill_has_service.pm
b/FS/FS/part_event/Condition/cust_bill_has_service.pm
index
7c1916b
..
898b08d
100644
(file)
--- a/
FS/FS/part_event/Condition/cust_bill_has_service.pm
+++ b/
FS/FS/part_event/Condition/cust_bill_has_service.pm
@@
-6,7
+6,7
@@
use FS::cust_bill;
use base qw( FS::part_event::Condition );
sub description {
use base qw( FS::part_event::Condition );
sub description {
- 'Invoice is billing for
a certain service type
';
+ 'Invoice is billing for
(any of) certain service definitions
';
}
sub eventtable_hashref {
}
sub eventtable_hashref {
@@
-16,13
+16,13
@@
sub eventtable_hashref {
};
}
};
}
-# could not find component for path '/elements/tr-select-part_svc.html'
-# sub disabled { 1; }
-
sub option_fields {
(
'has_service' => { 'label' => 'Has service',
'type' => 'select-part_svc',
sub option_fields {
(
'has_service' => { 'label' => 'Has service',
'type' => 'select-part_svc',
+ 'multiple' => 1, #the HTML element seems to have it
+ #by default, but edit/part_event.html
+ #(and process) need to know
},
);
}
},
);
}
@@
-31,26
+31,26
@@
sub condition {
#my($self, $cust_bill, %opt) = @_;
my($self, $cust_bill) = @_;
#my($self, $cust_bill, %opt) = @_;
my($self, $cust_bill) = @_;
- my $servicenum = $self->option('has_service');
+ my $servicenum = $self->option('has_service')
|| {}
;
- grep
{ $servicenum == $_->svcpart }
- map
{ $_->cust_svc }
+ grep
$servicenum->{ $_->svcpart },
+ map
$_->cust_svc,
$cust_bill->cust_pkg;
}
sub condition_sql {
my( $class, $table, %opt ) = @_;
$cust_bill->cust_pkg;
}
sub condition_sql {
my( $class, $table, %opt ) = @_;
- my $servicenum =
- $class->condition_sql_option_
integer('has_service', $opt{'driver_name'}
);
+ my $servicenum
s
=
+ $class->condition_sql_option_
option_integer('has_service'
);
- my $sql =
qq|
0 < ( SELECT COUNT(cs.svcpart)
+ my $sql =
"
0 < ( SELECT COUNT(cs.svcpart)
FROM cust_bill_pkg cbp, cust_svc cs
WHERE cbp.invnum = cust_bill.invnum
AND cs.pkgnum = cbp.pkgnum
FROM cust_bill_pkg cbp, cust_svc cs
WHERE cbp.invnum = cust_bill.invnum
AND cs.pkgnum = cbp.pkgnum
- AND cs.svcpart
= $servicenum
+ AND cs.svcpart
IN $servicenums
)
)
-
|
;
+
"
;
return $sql;
}
return $sql;
}