[freeside-commits] branch FREESIDE_4_BRANCH updated. 75866018ce20f390d3af012c8fb119a8e87616d3

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


The branch, FREESIDE_4_BRANCH has been updated
       via  75866018ce20f390d3af012c8fb119a8e87616d3 (commit)
      from  3671ac4f46054ab39aded867ec3e5d2732bdb6c3 (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 75866018ce20f390d3af012c8fb119a8e87616d3
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Feb 28 03:44:26 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