projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
beeeec1
)
Renamed $br to $br_permonth to clarify value is base_recur_permonth, NOT
author
Rob Van Dam
<rvandam00@gmail.com>
Thu, 6 Aug 2015 22:56:15 +0000
(16:56 -0600)
committer
Mark Wells
<mark@freeside.biz>
Sat, 29 Aug 2015 23:16:55 +0000
(16:16 -0700)
base_recur
FS/FS/part_pkg/discount_Mixin.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/discount_Mixin.pm
b/FS/FS/part_pkg/discount_Mixin.pm
index
3180275
..
47cb251
100644
(file)
--- a/
FS/FS/part_pkg/discount_Mixin.pm
+++ b/
FS/FS/part_pkg/discount_Mixin.pm
@@
-40,8
+40,8
@@
sub calc_discount {
my($self, $cust_pkg, $sdate, $details, $param ) = @_;
my $conf = new FS::Conf;
my($self, $cust_pkg, $sdate, $details, $param ) = @_;
my $conf = new FS::Conf;
- my $br = $self->base_recur_permonth($cust_pkg, $sdate);
- $br += $param->{'override_charges'} if $param->{'override_charges'};
+ my $br
_permonth
= $self->base_recur_permonth($cust_pkg, $sdate);
+ $br
_permonth
+= $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
my $tot_discount = 0;
#UI enforces just 1 for now, will need ordering when they can be stacked
@@
-83,7
+83,7
@@
sub calc_discount {
my $amount = 0;
$amount += $discount->amount
if $cust_pkg->pkgpart == $param->{'real_pkgpart'};
my $amount = 0;
$amount += $discount->amount
if $cust_pkg->pkgpart == $param->{'real_pkgpart'};
- $amount += sprintf('%.2f', $discount->percent * $br / 100 );
+ $amount += sprintf('%.2f', $discount->percent * $br
_permonth
/ 100 );
my $chg_months = defined($param->{'months'}) ?
$param->{'months'} :
$cust_pkg->part_pkg->freq;
my $chg_months = defined($param->{'months'}) ?
$param->{'months'} :
$cust_pkg->part_pkg->freq;
@@
-133,7
+133,7
@@
sub calc_discount {
};
}
};
}
- $amount = min($amount, $br);
+ $amount = min($amount, $br
_permonth
);
$amount *= $months;
}
$amount *= $months;
}
@@
-147,9
+147,9
@@
sub calc_discount {
&& !defined $param->{'setup_charge'}
)
{
&& !defined $param->{'setup_charge'}
)
{
- $discount_left = $br - $amount;
+ $discount_left = $br
_permonth
- $amount;
if ( $discount_left < 0 ) {
if ( $discount_left < 0 ) {
- $amount = $br;
+ $amount = $br
_permonth
;
$param->{'discount_left_setup'}{$discount->discountnum} =
0 - $discount_left;
}
$param->{'discount_left_setup'}{$discount->discountnum} =
0 - $discount_left;
}
@@
-188,7
+188,7
@@
sub calc_discount {
#}
#push @$details, $d;
#}
#push @$details, $d;
- #push @$details, sprintf( $format, $money_char, $br );
+ #push @$details, sprintf( $format, $money_char, $br
_permonth
);
}
}