From: Ivan Kohler Date: Wed, 1 Feb 2017 01:29:10 +0000 (-0800) Subject: add condition_sql optimization to "Package definitions" condition, RT#74456 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=f4daf7e8c831fe126dc3fd1d6d0db5ee3b46d602 add condition_sql optimization to "Package definitions" condition, RT#74456 --- diff --git a/FS/FS/part_event/Condition/pkg_pkgpart.pm b/FS/FS/part_event/Condition/pkg_pkgpart.pm index 6adef8eb6..d5b5c8daa 100644 --- a/FS/FS/part_event/Condition/pkg_pkgpart.pm +++ b/FS/FS/part_event/Condition/pkg_pkgpart.pm @@ -25,15 +25,16 @@ sub option_fields { sub condition { my( $self, $cust_pkg) = @_; - #XXX test my $if_pkgpart = $self->option('if_pkgpart') || {}; $if_pkgpart->{ $cust_pkg->pkgpart }; } -#XXX -#sub condition_sql { -# -#} +sub condition_sql { + my( $self, $table ) = @_; + + 'cust_pkg.pkgpart IN '. + $self->condition_sql_option_option_integer('if_pkgpart'); +} 1;