summaryrefslogtreecommitdiff
path: root/FS/FS/part_event
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-03-20 11:34:35 -0700
committerIvan Kohler <ivan@freeside.biz>2012-03-20 11:34:35 -0700
commit77c039757aa4733b1498bdfe25ab287f60698c72 (patch)
tree1f0cfb33b1560563d88307da75e4ce8c5806b234 /FS/FS/part_event
parent4d912748b3db3981fd03cdf74df7da696320f46d (diff)
fix multiple services w/cust_bill_has_service condition, RT#17035
Diffstat (limited to 'FS/FS/part_event')
-rw-r--r--FS/FS/part_event/Condition/cust_bill_has_service.pm12
1 files changed, 6 insertions, 6 deletions
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 3f3c908..80c47cf 100644
--- 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 {
- 'Invoice is billing for a certain service type';
+ 'Invoice is billing for certain service definitions';
}
sub eventtable_hashref {
@@ -34,10 +34,10 @@ sub condition {
#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;
}
@@ -45,13 +45,13 @@ sub condition_sql {
my( $class, $table, %opt ) = @_;
my $servicenum =
- $class->condition_sql_option_integer('has_service', $opt{'driver_name'});
+ $class->condition_sql_option_option('has_service');
my $sql = qq| 0 < ( SELECT COUNT(cs.svcpart)
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 $servicenum
)
|;
return $sql;