[freeside-commits] freeside/FS/FS Schema.pm, 1.239.2.35, 1.239.2.36 cust_pkg.pm, 1.179.2.22, 1.179.2.23 cust_pkg_discount.pm, 1.6.4.1, 1.6.4.2 discount.pm, 1.5, 1.5.2.1

Erik Levinson levinse at wavetail.420.am
Fri Apr 29 05:10:50 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv24952/FS/FS

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	Schema.pm cust_pkg.pm cust_pkg_discount.pm discount.pm 
Log Message:
apply discount to setup fees, part 1 of 2, RT11512

Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.239.2.35
retrieving revision 1.239.2.36
diff -u -w -d -r1.239.2.35 -r1.239.2.36
--- Schema.pm	25 Apr 2011 04:37:10 -0000	1.239.2.35
+++ Schema.pm	29 Apr 2011 12:10:47 -0000	1.239.2.36
@@ -1429,6 +1429,7 @@
         'percent',    'decimal',     '',      '', '', '',
         'months',     'decimal', 'NULL',      '', '', '',
         'disabled',      'char', 'NULL',       1, '', '', 
+        'setup',      'char', 'NULL',       1, '', '', 
       ],
       'primary_key' => 'discountnum',
       'unique' => [],

Index: cust_pkg_discount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg_discount.pm,v
retrieving revision 1.6.4.1
retrieving revision 1.6.4.2
diff -u -w -d -r1.6.4.1 -r1.6.4.2
--- cust_pkg_discount.pm	12 Jan 2011 06:26:43 -0000	1.6.4.1
+++ cust_pkg_discount.pm	29 Apr 2011 12:10:48 -0000	1.6.4.2
@@ -106,6 +106,7 @@
       'amount'   => $self->amount,
       'percent'  => $self->percent,
       'months'   => $self->months,
+      'setup'   => $self->setup,
       'disabled' => 'Y',
     };
     my $error = $discount->insert;

Index: discount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/discount.pm,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -w -d -r1.5 -r1.5.2.1
--- discount.pm	22 Sep 2010 19:16:17 -0000	1.5
+++ discount.pm	29 Apr 2011 12:10:48 -0000	1.5.2.1
@@ -54,6 +54,11 @@
 
 disabled
 
+=item setup - apply discount to setup fee (not just to recurring fee)
+
+If the discount is based on a percentage, then the % will be applied to the
+setup and recurring portions. 
+
 =back
 
 =head1 METHODS
@@ -130,6 +135,7 @@
     || $self->ut_float('percent') #actually decimal, but this will do
     || $self->ut_floatn('months') #actually decimal, but this will do
     || $self->ut_enum('disabled', [ '', 'Y' ])
+    || $self->ut_enum('setup', [ '', 'Y' ])
   ;
   return $error if $error;
 
@@ -176,6 +182,7 @@
   my $self = shift;
   my $desc = $self->description_short;
   $desc .= ' for '. $self->months. ' months' if $self->months;
+  $desc .= ', applies to setup' if $self->setup;
   $desc;
 }
 

Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.179.2.22
retrieving revision 1.179.2.23
diff -u -w -d -r1.179.2.22 -r1.179.2.23
--- cust_pkg.pm	25 Apr 2011 04:37:11 -0000	1.179.2.22
+++ cust_pkg.pm	29 Apr 2011 12:10:47 -0000	1.179.2.23
@@ -30,6 +30,7 @@
 use FS::cust_pkg_discount;
 use FS::discount;
 use FS::UI::Web;
+use Data::Dumper;
 
 # need to 'use' these instead of 'require' in sub { cancel, suspend, unsuspend,
 # setup }
@@ -1411,7 +1412,6 @@
 
 }
 
-use Data::Dumper;
 use Storable 'thaw';
 use MIME::Base64;
 sub process_bulk_cust_pkg {
@@ -2603,6 +2603,7 @@
     'amount'      => $self->discountnum_amount,
     'percent'     => $self->discountnum_percent,
     'months'      => $self->discountnum_months,
+    'setup'      => $self->discountnum_setup,
     #'disabled'    => $self->discountnum_disabled,
   };
 



More information about the freeside-commits mailing list