[freeside-commits] branch FREESIDE_3_BRANCH updated. 78c6addcb5adb3fc119eeabb6ac827ba0d498091

Christopher Burger burgerc at freeside.biz
Tue Dec 12 12:01:38 PST 2017


The branch, FREESIDE_3_BRANCH has been updated
       via  78c6addcb5adb3fc119eeabb6ac827ba0d498091 (commit)
       via  2aacf617dc20abae652017085aa1cc15cb8a8842 (commit)
       via  e4e97a0696aa718bef0e725f2f5e3cbded98f1af (commit)
       via  72210c8579e5d5ffeb3127afb1d35236417aa469 (commit)
       via  020e2df25391da9028dfbd9962b554ac20f54f38 (commit)
       via  e122171357abcfb53719a23ffeb8345e1c88381d (commit)
      from  5030e8026dac97b45095e1d1dbb4a80b874662e9 (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 78c6addcb5adb3fc119eeabb6ac827ba0d498091
Merge: 2aacf617d 5030e8026
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Dec 12 14:58:01 2017 -0500

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


commit 2aacf617dc20abae652017085aa1cc15cb8a8842
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Dec 12 14:57:29 2017 -0500

    RT# 24643 - Version 3 changes to allow for waive setup fee on change packages

diff --git a/httemplate/edit/process/change-cust_pkg.html b/httemplate/edit/process/change-cust_pkg.html
index 0e87ad859..e1b220e51 100644
--- a/httemplate/edit/process/change-cust_pkg.html
+++ b/httemplate/edit/process/change-cust_pkg.html
@@ -27,7 +27,7 @@ my $cust_pkg = qsearchs({
 die 'unknown pkgnum' unless $cust_pkg;
 
 my %change = map { $_ => scalar($cgi->param($_)) }
-                 qw( locationnum pkgpart quantity );
+                 qw( locationnum pkgpart quantity waive_setup);
 
 $change{'keep_dates'} = 1;
 
@@ -40,18 +40,6 @@ if ( $cgi->param('locationnum') == -1 ) {
   $change{'cust_location'} = $cust_location;
 }
 
-$change{waive_setup} = '';
-
-if ( $cgi->param('setup_discountnum') =~ /^(-?\d+)$/ ) { 
-  if ( $1 == -2 ) {
-    $change{waive_setup} = 'Y';
-  } else {
-    $change{setup_discountnum} = $1;
-    $change{setup_discountnum_amount} = $cgi->param('setup_discountnum_amount');
-    $change{setup_discountnum_percent} = $cgi->param('setup_discountnum_percent');
-  }
-}
-
 my $error;
 my $now = time;
 if (defined($cgi->param('contract_end'))) {
@@ -81,8 +69,7 @@ unless ($error) {
         $change_to->locationnum  == $change{'locationnum'} and
         $change_to->quantity     == $change{'quantity'} and
         $change_to->contract_end == $change{'contract_end'} and
-        $change_to->waive_setup  == $change{'waive_setup'} and
-        !$usagechanged
+        $change_to->waive_setup  == $change{'waive_setup'}
       ) {
         %change = ( 'cust_pkg' => $change_to );
       }
diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi
index 13fc05016..94f32e699 100755
--- a/httemplate/misc/change_pkg.cgi
+++ b/httemplate/misc/change_pkg.cgi
@@ -78,7 +78,14 @@
 % if ( $discount_cust_pkg || $waive_setup_fee ) {
   <FONT CLASS="fsinnerbox-title"><% mt('Discounting') |h %></FONT>
   <% ntable("#cccccc") %>
-    <& /elements/tr-select-pkg-discount.html, disable_recur => 1, &>
+
+%   if ( $waive_setup_fee ) {
+      <TR>
+        <TH ALIGN="right"><% mt('Waive setup fee') |h %> </TH>
+        <TD COLSPAN=6><INPUT TYPE="checkbox" NAME="waive_setup" VALUE="Y"></TD>
+      </TR>
+%   }
+
   </TABLE><BR>
 
 % }

commit e4e97a0696aa718bef0e725f2f5e3cbded98f1af
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Nov 28 20:45:12 2017 -0500

    RT# 24643 - fixed error in saving waive setup fee flag when not selected

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index c95d31b4d..b2cc874a4 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2363,7 +2363,8 @@ sub change {
     $same_pkgpart = 0;
   }
 
-  $self->set('waive_setup', $opt->{'waive_setup'}) if $opt->{'waive_setup'};
+  if ($opt->{'waive_setup'}) { $self->set('waive_setup', $opt->{'waive_setup'}) }
+  else { $self->set('waive_setup', ''); }
 
   # Before going any further here: if the package is still in the pre-setup
   # state, it's safe to modify it in place. No need to charge/credit for 
diff --git a/httemplate/edit/process/change-cust_pkg.html b/httemplate/edit/process/change-cust_pkg.html
index 3d50a134e..0e87ad859 100644
--- a/httemplate/edit/process/change-cust_pkg.html
+++ b/httemplate/edit/process/change-cust_pkg.html
@@ -40,6 +40,8 @@ if ( $cgi->param('locationnum') == -1 ) {
   $change{'cust_location'} = $cust_location;
 }
 
+$change{waive_setup} = '';
+
 if ( $cgi->param('setup_discountnum') =~ /^(-?\d+)$/ ) { 
   if ( $1 == -2 ) {
     $change{waive_setup} = 'Y';

commit 72210c8579e5d5ffeb3127afb1d35236417aa469
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Tue Nov 28 20:17:28 2017 -0500

    Revert "RT# 24643 - fixed error in saving waive setup fee flag when not selected"
    
    This reverts commit 7e2111f1ebc063df6a0afbb5903ae17a96ca3bb8.

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index b2cc874a4..c95d31b4d 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2363,8 +2363,7 @@ sub change {
     $same_pkgpart = 0;
   }
 
-  if ($opt->{'waive_setup'}) { $self->set('waive_setup', $opt->{'waive_setup'}) }
-  else { $self->set('waive_setup', ''); }
+  $self->set('waive_setup', $opt->{'waive_setup'}) if $opt->{'waive_setup'};
 
   # Before going any further here: if the package is still in the pre-setup
   # state, it's safe to modify it in place. No need to charge/credit for 
diff --git a/httemplate/edit/process/change-cust_pkg.html b/httemplate/edit/process/change-cust_pkg.html
index 0e87ad859..3d50a134e 100644
--- a/httemplate/edit/process/change-cust_pkg.html
+++ b/httemplate/edit/process/change-cust_pkg.html
@@ -40,8 +40,6 @@ if ( $cgi->param('locationnum') == -1 ) {
   $change{'cust_location'} = $cust_location;
 }
 
-$change{waive_setup} = '';
-
 if ( $cgi->param('setup_discountnum') =~ /^(-?\d+)$/ ) { 
   if ( $1 == -2 ) {
     $change{waive_setup} = 'Y';

commit 020e2df25391da9028dfbd9962b554ac20f54f38
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Mon May 28 00:07:20 2018 -0400

    RT# 24643 - fixed error in saving waive setup fee flag when not selected

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index c95d31b4d..b2cc874a4 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2363,7 +2363,8 @@ sub change {
     $same_pkgpart = 0;
   }
 
-  $self->set('waive_setup', $opt->{'waive_setup'}) if $opt->{'waive_setup'};
+  if ($opt->{'waive_setup'}) { $self->set('waive_setup', $opt->{'waive_setup'}) }
+  else { $self->set('waive_setup', ''); }
 
   # Before going any further here: if the package is still in the pre-setup
   # state, it's safe to modify it in place. No need to charge/credit for 
diff --git a/httemplate/edit/process/change-cust_pkg.html b/httemplate/edit/process/change-cust_pkg.html
index 3d50a134e..0e87ad859 100644
--- a/httemplate/edit/process/change-cust_pkg.html
+++ b/httemplate/edit/process/change-cust_pkg.html
@@ -40,6 +40,8 @@ if ( $cgi->param('locationnum') == -1 ) {
   $change{'cust_location'} = $cust_location;
 }
 
+$change{waive_setup} = '';
+
 if ( $cgi->param('setup_discountnum') =~ /^(-?\d+)$/ ) { 
   if ( $1 == -2 ) {
     $change{waive_setup} = 'Y';

commit e122171357abcfb53719a23ffeb8345e1c88381d
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Wed Feb 22 13:36:15 2017 -0500

    RT# 24643, added waive setup fee option to change package screen.
    
    Conflicts:
            httemplate/edit/process/change-cust_pkg.html

diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 91c5bd3eb..c95d31b4d 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -2363,13 +2363,15 @@ sub change {
     $same_pkgpart = 0;
   }
 
+  $self->set('waive_setup', $opt->{'waive_setup'}) if $opt->{'waive_setup'};
+
   # Before going any further here: if the package is still in the pre-setup
   # state, it's safe to modify it in place. No need to charge/credit for 
   # partial period, transfer usage pools, copy invoice details, or change any
   # dates. We DO need to "transfer" services (from the package to itself) to
   # check their validity on the new pkgpart.
   if ( ! $self->setup and ! $opt->{cust_pkg} and ! $opt->{cust_main} ) {
-    foreach ( qw( locationnum pkgpart quantity refnum salesnum ) ) {
+    foreach ( qw( locationnum pkgpart quantity refnum salesnum waive_setup ) ) {
       if ( length($opt->{$_}) ) {
         $self->set($_, $opt->{$_});
       }
diff --git a/httemplate/edit/process/change-cust_pkg.html b/httemplate/edit/process/change-cust_pkg.html
index 046a9795c..3d50a134e 100644
--- a/httemplate/edit/process/change-cust_pkg.html
+++ b/httemplate/edit/process/change-cust_pkg.html
@@ -40,6 +40,16 @@ if ( $cgi->param('locationnum') == -1 ) {
   $change{'cust_location'} = $cust_location;
 }
 
+if ( $cgi->param('setup_discountnum') =~ /^(-?\d+)$/ ) { 
+  if ( $1 == -2 ) {
+    $change{waive_setup} = 'Y';
+  } else {
+    $change{setup_discountnum} = $1;
+    $change{setup_discountnum_amount} = $cgi->param('setup_discountnum_amount');
+    $change{setup_discountnum_percent} = $cgi->param('setup_discountnum_percent');
+  }
+}
+
 my $error;
 my $now = time;
 if (defined($cgi->param('contract_end'))) {
@@ -68,7 +78,9 @@ unless ($error) {
         $change_to->pkgpart      == $change{'pkgpart'} and
         $change_to->locationnum  == $change{'locationnum'} and
         $change_to->quantity     == $change{'quantity'} and
-        $change_to->contract_end == $change{'contract_end'}
+        $change_to->contract_end == $change{'contract_end'} and
+        $change_to->waive_setup  == $change{'waive_setup'} and
+        !$usagechanged
       ) {
         %change = ( 'cust_pkg' => $change_to );
       }
diff --git a/httemplate/misc/change_pkg.cgi b/httemplate/misc/change_pkg.cgi
index e74747e82..13fc05016 100755
--- a/httemplate/misc/change_pkg.cgi
+++ b/httemplate/misc/change_pkg.cgi
@@ -72,6 +72,16 @@
 </TABLE>
 </BR>
 
+% my $discount_cust_pkg = $curuser->access_right('Discount customer package');
+% my $waive_setup_fee   = $curuser->access_right('Waive setup fee');
+%
+% if ( $discount_cust_pkg || $waive_setup_fee ) {
+  <FONT CLASS="fsinnerbox-title"><% mt('Discounting') |h %></FONT>
+  <% ntable("#cccccc") %>
+    <& /elements/tr-select-pkg-discount.html, disable_recur => 1, &>
+  </TABLE><BR>
+
+% }
 
 <FONT CLASS="fsinnerbox-title"><% mt('Location') |h %></FONT>
 <% ntable('#cccccc') %>

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_pkg.pm                            |  5 ++++-
 httemplate/edit/process/change-cust_pkg.html |  5 +++--
 httemplate/misc/change_pkg.cgi               | 17 +++++++++++++++++
 3 files changed, 24 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list