[freeside-commits] freeside/FS/FS Schema.pm, 1.293, 1.294 cust_pkg.pm, 1.201, 1.202 cust_pkg_discount.pm, 1.7, 1.8 discount.pm, 1.5, 1.6
Erik Levinson
levinse at wavetail.420.am
Fri Apr 29 05:10:20 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv24946/FS/FS
Modified Files:
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.293
retrieving revision 1.294
diff -u -w -d -r1.293 -r1.294
--- Schema.pm 29 Apr 2011 08:58:18 -0000 1.293
+++ Schema.pm 29 Apr 2011 12:10:15 -0000 1.294
@@ -1534,6 +1534,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.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- cust_pkg_discount.pm 12 Jan 2011 06:26:42 -0000 1.7
+++ cust_pkg_discount.pm 29 Apr 2011 12:10:16 -0000 1.8
@@ -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.6
diff -u -w -d -r1.5 -r1.6
--- discount.pm 22 Sep 2010 19:16:17 -0000 1.5
+++ discount.pm 29 Apr 2011 12:10:16 -0000 1.6
@@ -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.201
retrieving revision 1.202
diff -u -w -d -r1.201 -r1.202
--- cust_pkg.pm 25 Apr 2011 04:37:08 -0000 1.201
+++ cust_pkg.pm 29 Apr 2011 12:10:16 -0000 1.202
@@ -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 }
@@ -1416,7 +1417,6 @@
}
-use Data::Dumper;
use Storable 'thaw';
use MIME::Base64;
sub process_bulk_cust_pkg {
@@ -2608,6 +2608,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