X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fflat.pm;h=6db6eee24e0f9d99d956c6794c6e6bbc7c707a0b;hb=20f38e4c256094bd938b732950e8f93319f851a5;hp=8cffaffa784158c605be435f94273a18582e5d6e;hpb=b66775c3f693b5204d8f88afba17cb2aeae05120;p=freeside.git diff --git a/FS/FS/part_pkg/flat.pm b/FS/FS/part_pkg/flat.pm index 8cffaffa7..6db6eee24 100644 --- a/FS/FS/part_pkg/flat.pm +++ b/FS/FS/part_pkg/flat.pm @@ -158,8 +158,7 @@ sub unit_setup { } sub calc_recur { - my $self = shift; - my($cust_pkg) = @_; + my($self, $cust_pkg, $sdate, $details, $param ) = @_; #my $last_bill = $cust_pkg->last_bill; my $last_bill = $cust_pkg->get('last_bill'); #->last_bill falls back to setup @@ -167,18 +166,17 @@ sub calc_recur { return 0 if $self->option('recur_temporality', 1) eq 'preceding' && $last_bill == 0; - my $br = $self->base_recur(@_); + my $br = $self->base_recur($cust_pkg); - my $discount = $self->calc_discount(@_); + my $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param); sprintf('%.2f', $br - $discount); } sub calc_discount { - my $self = shift; - my($cust_pkg, $sdate, $details, $param ) = @_; + my($self, $cust_pkg, $sdate, $details, $param ) = @_; - my $br = $self->base_recur(@_); + my $br = $self->base_recur($cust_pkg); my $tot_discount = 0; #UI enforces just 1 for now, will need ordering when they can be stacked