[freeside-commits] branch FREESIDE_4_BRANCH updated. d70cfa65d09780eeb9ff020e122b73634c5c6b35

Ivan ivan at 420.am
Mon Apr 25 14:45:10 PDT 2016


The branch, FREESIDE_4_BRANCH has been updated
       via  d70cfa65d09780eeb9ff020e122b73634c5c6b35 (commit)
       via  9dfb57058b3856c2a35c27b5c586ea02cf74d010 (commit)
      from  dc15d03b6daa1f41d94f1e2064c3aed4d6971766 (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 d70cfa65d09780eeb9ff020e122b73634c5c6b35
Merge: 9dfb570 dc15d03
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Apr 25 14:45:06 2016 -0700

    Merge branch 'FREESIDE_4_BRANCH' of git.freeside.biz:/home/git/freeside into FREESIDE_4_BRANCH


commit 9dfb57058b3856c2a35c27b5c586ea02cf74d010
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Apr 25 14:44:59 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