projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0e21e4e
)
fix recur_Common packages with setup discounts
author
ivan
<ivan>
Mon, 24 Oct 2011 22:48:29 +0000
(22:48 +0000)
committer
ivan
<ivan>
Mon, 24 Oct 2011 22:48:29 +0000
(22:48 +0000)
FS/FS/part_pkg/recur_Common.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg/recur_Common.pm
b/FS/FS/part_pkg/recur_Common.pm
index
07ade81
..
7197eae
100644
(file)
--- a/
FS/FS/part_pkg/recur_Common.pm
+++ b/
FS/FS/part_pkg/recur_Common.pm
@@
-22,8
+22,19
@@
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) = @_;
sub calc_setup {
# moved from all descendant packages which just had $self->option('setup_fee')
my($self, $cust_pkg, $sdate, $details, $param) = @_;
+
return 0 if $self->prorate_setup($cust_pkg, $sdate);
return 0 if $self->prorate_setup($cust_pkg, $sdate);
- $self->option('setup_fee');
+
+ 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);
+ delete $param->{'setup_charge'};
+ }
+
+ sprintf('%.2f', $charge - $discount);
}
sub cutoff_day {
}
sub cutoff_day {