X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2Fcust_pkg.pm;h=07c5a4756b58e875b87581d5289ce4805639a548;hb=e884af8c6997d97753598ccec16a3156e0dcbf3f;hp=b24b3abe3cdf924f495644bc068febfc4d71a83d;hpb=8c36d1e4f1255abb483bc7372fa1908cc192b528;p=freeside.git diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index b24b3abe3..07c5a4756 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -3329,11 +3329,10 @@ sub process_bulk_cust_pkg { my $param = shift; warn Dumper($param) if $DEBUG; - my $old_part_pkg = qsearchs('part_pkg', - { pkgpart => $param->{'old_pkgpart'} }); my $new_part_pkg = qsearchs('part_pkg', { pkgpart => $param->{'new_pkgpart'} }); - die "Must select a new package type\n" unless $new_part_pkg; + die "Must select a new package definition\n" unless $new_part_pkg; + #my $keep_dates = $param->{'keep_dates'} || 0; my $keep_dates = 1; # there is no good reason to turn this off @@ -3341,7 +3340,14 @@ sub process_bulk_cust_pkg { local $FS::UID::AutoCommit = 0; my $dbh = dbh; - my @cust_pkgs = qsearch('cust_pkg', { 'pkgpart' => $param->{'old_pkgpart'} } ); + my @old_pkgpart = ref($param->{'old_pkgpart'}) ? @{ $param->{'old_pkgpart'} } + : $param->{'old_pkgpart'}; + + my @cust_pkgs = qsearch({ + 'table' => 'cust_pkg', + 'extra_sql' => ' WHERE pkgpart IN ('. + join(',', @old_pkgpart). ')', + }); my $i = 0; foreach my $old_cust_pkg ( @cust_pkgs ) {