summaryrefslogtreecommitdiff
path: root/FS/FS/part_pkg
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2019-07-26 11:10:28 -0700
committerIvan Kohler <ivan@freeside.biz>2019-07-26 11:10:28 -0700
commitcc4e6579fd8aade3bf74cf9d8d826fe33576ccc8 (patch)
tree6443f700f768ef180e13663b47679a12b57bd453 /FS/FS/part_pkg
parent6db5c31175c207fd6fdae97b1d7ecb719d6c94aa (diff)
fix intro rates packages vs discounts, RT#83503
Diffstat (limited to 'FS/FS/part_pkg')
-rw-r--r--FS/FS/part_pkg/flat.pm10
-rw-r--r--FS/FS/part_pkg/recur_Common.pm6
2 files changed, 8 insertions, 8 deletions
diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm
index 6fd9c7d..a7a3768 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -114,9 +114,9 @@ sub price_info {
}
sub calc_setup {
- my($self, $cust_pkg, $sdate, $details, $param ) = @_;
+ my($self, $cust_pkg, $time, $details, $param ) = @_;
- return 0 if $self->prorate_setup($cust_pkg, $sdate);
+ return 0 if $self->prorate_setup($cust_pkg, $time);
my $i = 0;
my $count = $self->option( 'additional_count', 'quiet' ) || 0;
@@ -124,12 +124,12 @@ sub calc_setup {
push @$details, $self->option( 'additional_info' . $i++ );
}
- my $charge = $self->base_setup($cust_pkg, $sdate, $details);
+ my $charge = $self->base_setup($cust_pkg, $time, $details);
my $discount = 0;
if ( $charge > 0 ) {
$param->{'setup_charge'} = $charge;
- $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
+ $discount = $self->calc_discount($cust_pkg, \$time, $details, $param);
delete $param->{'setup_charge'};
}
@@ -137,7 +137,7 @@ sub calc_setup {
}
sub base_setup {
- my($self, $cust_pkg, $sdate, $details ) = @_;
+ my($self, $cust_pkg, $time, $details ) = @_;
$self->option('setup_fee', 1) || 0;
}
diff --git a/FS/FS/part_pkg/recur_Common.pm b/FS/FS/part_pkg/recur_Common.pm
index 729fb61..fc87628 100644
--- a/FS/FS/part_pkg/recur_Common.pm
+++ b/FS/FS/part_pkg/recur_Common.pm
@@ -21,16 +21,16 @@ sub base_recur {
sub calc_setup {
# moved from all descendant packages which just had $self->option('setup_fee')
- my($self, $cust_pkg, $sdate, $details, $param) = @_;
+ my($self, $cust_pkg, $time, $details, $param) = @_;
- return 0 if $self->prorate_setup($cust_pkg, $sdate);
+ return 0 if $self->prorate_setup($cust_pkg, $time);
my $charge = $self->option('setup_fee');
my $discount = 0;
if ( $charge > 0 ) {
$param->{'setup_charge'} = $charge;
- $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param);
+ $discount = $self->calc_discount($cust_pkg, \$time, $details, $param);
delete $param->{'setup_charge'};
}