summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2019-07-26 11:10:11 -0700
committerIvan Kohler <ivan@freeside.biz>2019-07-26 11:10:11 -0700
commit74f4610304eb373363ac07fc6e655d16c5f0ed33 (patch)
tree6660166972282109c6a0a4dcf4ca1f47ad0cdc3b
parent7917cc1f73ef49554d05bc5039add533be725a3e (diff)
fix intro rates packages vs discounts, RT#83503
-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 c06328b1b..762ecebc0 100644
--- a/FS/FS/part_pkg/flat.pm
+++ b/FS/FS/part_pkg/flat.pm
@@ -121,9 +121,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;
@@ -131,12 +131,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'};
}
@@ -144,7 +144,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 729fb6125..fc87628ea 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'};
}