[freeside-commits] branch FREESIDE_3_BRANCH updated. 055f426339c9451fae6f6db6569ceb10634bf06c
Ivan
ivan at 420.am
Mon Apr 25 14:45:20 PDT 2016
The branch, FREESIDE_3_BRANCH has been updated
via 055f426339c9451fae6f6db6569ceb10634bf06c (commit)
from 4300dd2e09cb0544c067a2d9a9fd92e534e49802 (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 055f426339c9451fae6f6db6569ceb10634bf06c
Author: Ivan Kohler <ivan at freeside.biz>
Date: Mon Apr 25 14:45:13 2016 -0700
add comment selection and change zero recurring flags, RT#41733
diff --git a/bin/part_pkg-bulk_change b/bin/part_pkg-bulk_change
index cf65c39..f6d8b6c 100755
--- a/bin/part_pkg-bulk_change
+++ b/bin/part_pkg-bulk_change
@@ -8,15 +8,16 @@ use FS::Record qw(qsearch qsearchs);
use FS::part_pkg;
use FS::part_pkg_option;
-getopts('rp:o:v:');
+getopts('rm:p:o:v:sSzZ');
my $user = shift or &usage;
adminsuidsetup $user;
-my %plan;
-%plan = ( 'plan' => $opt_p ) if $opt_p;
+my %search = ();
+$search{'plan'} = $opt_p if $opt_p;
+$search{'comment'} = $opt_m if $opt_m;
-foreach my $part_pkg ( qsearch('part_pkg',\%plan) ) {
+foreach my $part_pkg ( qsearch('part_pkg',\%search) ) {
next if ! $part_pkg->freq && $opt_r;
my %hash = (
@@ -37,10 +38,22 @@ foreach my $part_pkg ( qsearch('part_pkg',\%plan) ) {
die $error if $error;
}
+ if ( $opt_t || $opt_s || $opt_S || $opt_z || $opt_Z ) {
+
+ $part_pkg->setup_show_zero('') if $opt_s;
+ $part_pkg->setup_show_zero('Y') if $opt_S;
+ $part_pkg->recur_show_zero('') if $opt_z;
+ $part_pkg->recur_show_zero('Y') if $opt_Z;
+
+ $part_pkg->taxclass($opt_t);
+ my $error = $part_pkg->replace;
+
+ }
+
}
sub usage {
- die "usage: part_pkg-bulk_change [ -r ] -o option_name -v option_value employee_username\n";
+ die "usage: part_pkg-bulk_change [ -r ] [ -p plan ] [ -m comment ] [ -o option_name -v option_value ] [ -s | -S ] [ -z | -Z ] employee_username\n";
}
=head1 NAME
@@ -49,18 +62,34 @@ cust_main-bulk_change
=head1 SYNOPSIS
- part_pkg-bulk_change [ -r ] -o option_name -v option_value employee_username
+ part_pkg-bulk_change [ -r ] [ -p plan ] [ -m comment ] [ -o option_name -v option_value ] [ -s | -S ] [ -z | -Z ] employee_username
=head1 DESCRIPTION
Command-line tool to change a set of package definitions.
+Search options:
+
-r: recurring package definitions only
+-p: packages with this price plan only
+
+-m: packages with this comment only
+
+Change options:
+
-o: part_pkg_option optionname
-v: part_pkg_option optionvalue
+-s: Turn off "Show zero setup"
+
+-S: Turn on "Show zero setup"
+
+-z: Turn off "Show zero recurring"
+
+-Z: Turn on "Show zero recurring"
+
employee_username
=head1 BUGS
-----------------------------------------------------------------------
Summary of changes:
bin/part_pkg-bulk_change | 41 +++++++++++++++++++++++++++++++++++------
1 file changed, 35 insertions(+), 6 deletions(-)
More information about the freeside-commits
mailing list