[freeside-commits] branch master updated. 5c3409b2a987a9a6fc6ca77bcaceb4b7cefa03de

Ivan ivan at 420.am
Mon Apr 25 14:44:55 PDT 2016


The branch, master has been updated
       via  5c3409b2a987a9a6fc6ca77bcaceb4b7cefa03de (commit)
       via  55f39e02bdf73d449212fe1ccc049ebebcf85f9e (commit)
      from  0a0c17589441e09243a5d1b8a27fad149118271c (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 5c3409b2a987a9a6fc6ca77bcaceb4b7cefa03de
Merge: 55f39e0 0a0c175
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Apr 25 14:44:52 2016 -0700

    Merge branch 'master' of git.freeside.biz:/home/git/freeside


commit 55f39e02bdf73d449212fe1ccc049ebebcf85f9e
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Apr 25 14:44:48 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 cb29b18..6a72f93 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:t:');
+getopts('rm:p:o:v:t: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;
 
   if ( $opt_o ) {
@@ -43,9 +44,14 @@ foreach my $part_pkg ( qsearch('part_pkg',\%plan) ) {
 
   }
 
-  if ( $opt_t ) {
+  if ( $opt_t || $opt_s || $opt_S || $opt_z || $opt_Z ) {
+
+    $part_pkg->taxclass($opt_t) if $opt_t;
+    $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;
 
   }
@@ -53,7 +59,7 @@ foreach my $part_pkg ( qsearch('part_pkg',\%plan) ) {
 }
 
 sub usage {
-  die "usage: part_pkg-bulk_change [ -r ] [ -o option_name -v option_value ] [ -t new_taxclass ] employee_username\n";
+  die "usage: part_pkg-bulk_change [ -r ] [ -p plan ] [ -m comment ] [ -o option_name -v option_value ] [ -t new_taxclass ] [ -s | -S ] [ -z | -Z ] employee_username\n";
 }
 
 =head1 NAME
@@ -62,7 +68,7 @@ cust_main-bulk_change
 
 =head1 SYNOPSIS
 
-  part_pkg-bulk_change [ -r ] [ -o option_name -v option_value ] [ -t new_taxclass ] employee_username
+  part_pkg-bulk_change [ -r ] [ -p plan ] [ -m comment ] [ -o option_name -v option_value ] [ -t new_taxclass ] [ -s | -S ] [ -z | -Z ] employee_username
 
 =head1 DESCRIPTION
 
@@ -72,6 +78,10 @@ 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
@@ -80,6 +90,14 @@ Change options:
 
 -t: new taxclass
 
+-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 |   34 ++++++++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list