projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 83259 - adding/editing tower sector will no check for required fields prior to...
[freeside.git]
/
bin
/
part_pkg-bulk_change
diff --git
a/bin/part_pkg-bulk_change
b/bin/part_pkg-bulk_change
index
176965b
..
5347da6
100755
(executable)
--- 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;
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 ) {
next if ! $part_pkg->freq && $opt_r;
if ( $opt_o ) {