X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=bin%2Fpart_pkg-bulk_change;h=cf65c39a282c26f617c4be14a83f874d7cc3a221;hb=d51f9090afefa9e29200fc1df6e88e8c24a55657;hp=aecfea5805162a925dccb159d08679799bb0a91f;hpb=b17ce7c641ad897ec35cac0c8f8e69320c19ab0e;p=freeside.git diff --git a/bin/part_pkg-bulk_change b/bin/part_pkg-bulk_change index aecfea580..cf65c39a2 100755 --- a/bin/part_pkg-bulk_change +++ b/bin/part_pkg-bulk_change @@ -1,19 +1,22 @@ #!/usr/bin/perl use strict; -use vars qw( $opt_r $opt_o $opt_v ); +use vars qw( $opt_r $opt_p $opt_o $opt_v ); use Getopt::Std; use FS::UID qw(adminsuidsetup); use FS::Record qw(qsearch qsearchs); use FS::part_pkg; use FS::part_pkg_option; -getopts('ro:v:'); +getopts('rp:o:v:'); my $user = shift or &usage; adminsuidsetup $user; -foreach my $part_pkg ( qsearch('part_pkg', {}) ) { +my %plan; +%plan = ( 'plan' => $opt_p ) if $opt_p; + +foreach my $part_pkg ( qsearch('part_pkg',\%plan) ) { next if ! $part_pkg->freq && $opt_r; my %hash = ( @@ -50,7 +53,7 @@ cust_main-bulk_change =head1 DESCRIPTION -Command-line tool to change the payby field for a group of customers. +Command-line tool to change a set of package definitions. -r: recurring package definitions only