[freeside-commits] freeside/FS/FS/part_pkg sql_external.pm, 1.11.2.1, 1.11.2.2 recur_Common.pm, 1.7, 1.7.2.1 discount_Mixin.pm, 1.1, 1.1.2.1
Erik Levinson
levinse at wavetail.420.am
Mon Jan 17 21:21:11 PST 2011
- Previous message: [freeside-commits] freeside/FS/FS/part_pkg sql_external.pm, 1.12, 1.13 recur_Common.pm, 1.7, 1.8 discount_Mixin.pm, 1.1, 1.2
- Next message: [freeside-commits] freeside/FS/FS Conf.pm, 1.419, 1.420 cust_bill.pm, 1.303, 1.304
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv19407/FS/FS/part_pkg
Modified Files:
Tag: FREESIDE_2_1_BRANCH
sql_external.pm recur_Common.pm discount_Mixin.pm
Log Message:
add discount capability to sql_external, RT10481
Index: sql_external.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/sql_external.pm,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -u -w -d -r1.11.2.1 -r1.11.2.2
--- sql_external.pm 24 Dec 2010 09:49:49 -0000 1.11.2.1
+++ sql_external.pm 18 Jan 2011 05:21:09 -0000 1.11.2.2
@@ -1,7 +1,7 @@
package FS::part_pkg::sql_external;
use strict;
-use base qw( FS::part_pkg::recur_Common );
+use base qw( FS::part_pkg::recur_Common FS::part_pkg::discount_Mixin );
use vars qw( %info );
use DBI;
#use FS::Record qw(qsearch qsearchs);
@@ -47,9 +47,8 @@
sub calc_recur {
my $self = shift;
- my($cust_pkg) = @_; #, $sdate, $details, $param ) = @_;
-
- my $price = $self->calc_recur_Common(@_);
+ my($cust_pkg, $sdate, $details, $param ) = @_;
+ my $price = 0;
my $dbh = DBI->connect( map { $self->option($_) }
qw( datasrc db_username db_password )
@@ -67,10 +66,11 @@
$price += $sth->fetchrow_arrayref->[0];
}
- $price;
+ $param->{'override_charges'} = $price;
+ $self->calc_recur_Common($cust_pkg,$sdate,$details,$param);
}
-sub can_discount { 0; }
+sub can_discount { 1; }
sub is_free { 0; }
Index: recur_Common.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/recur_Common.pm,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -u -w -d -r1.7 -r1.7.2.1
--- recur_Common.pm 30 Oct 2010 23:22:31 -0000 1.7
+++ recur_Common.pm 18 Jan 2011 05:21:09 -0000 1.7.2.1
@@ -32,6 +32,7 @@
my $recur_method = $self->option('recur_method', 1) || 'anniversary';
$charges = $self->base_recur;
+ $charges += $param->{'override_charges'} if $param->{'override_charges'};
if ( $recur_method eq 'prorate' ) {
my $cutoff_day = $self->option('cutoff_day') || 1;
Index: discount_Mixin.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/discount_Mixin.pm,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -w -d -r1.1 -r1.1.2.1
--- discount_Mixin.pm 30 Oct 2010 23:22:31 -0000 1.1
+++ discount_Mixin.pm 18 Jan 2011 05:21:09 -0000 1.1.2.1
@@ -42,6 +42,7 @@
my($self, $cust_pkg, $sdate, $details, $param ) = @_;
my $br = $self->base_recur($cust_pkg);
+ $br += $param->{'override_charges'} if $param->{'override_charges'};
my $tot_discount = 0;
#UI enforces just 1 for now, will need ordering when they can be stacked
- Previous message: [freeside-commits] freeside/FS/FS/part_pkg sql_external.pm, 1.12, 1.13 recur_Common.pm, 1.7, 1.8 discount_Mixin.pm, 1.1, 1.2
- Next message: [freeside-commits] freeside/FS/FS Conf.pm, 1.419, 1.420 cust_bill.pm, 1.303, 1.304
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list