[freeside-commits] branch master updated. 8b2094d8837af641d3d28b7a76fa460c7d85456e

Ivan Kohler ivan at freeside.biz
Thu Feb 28 03:44:24 PST 2019


The branch, master has been updated
       via  8b2094d8837af641d3d28b7a76fa460c7d85456e (commit)
      from  d285949574cc657ff52a49c028478361442b9e22 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8b2094d8837af641d3d28b7a76fa460c7d85456e
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Feb 28 03:44:21 2019 -0800

    fix -C, RT#82943

diff --git a/bin/part_pkg-bulk_change b/bin/part_pkg-bulk_change
index 176965baf..5347da6be 100755
--- a/bin/part_pkg-bulk_change
+++ b/bin/part_pkg-bulk_change
@@ -16,9 +16,18 @@ adminsuidsetup $user;
 my %search = ();
 $search{'plan'} = $opt_p if $opt_p;
 $search{'comment'} = $opt_m if $opt_m;
-$search{'classnum'} = { op=>'NOT IN', value=>"($opt_C)" } if $opt_C;
 
-foreach my $part_pkg ( qsearch('part_pkg',\%search) ) {
+my $extra_sql = '';
+$extra_sql = ( keys(%search) ? 'AND' : 'WHERE' ).
+             " classnum NOT IN ($opt_C)"
+  if $opt_C;
+
+foreach my $part_pkg ( qsearch({ 'table'     => 'part_pkg',
+                                 'hashref'   => \%search,
+                                 'extra_sql' => $extra_sql,
+                              })
+                     )
+{
   next if ! $part_pkg->freq && $opt_r;
 
   if ( $opt_o ) {

-----------------------------------------------------------------------

Summary of changes:
 bin/part_pkg-bulk_change | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)




More information about the freeside-commits mailing list