X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fbulk_Common.pm;h=3477c444c2788b0b1a16562938715a71227b4bb9;hb=5716d52ab6d97510b5e470d53a4feb50d34a11c7;hp=26550df7003f8ec3cf34d7b4a05171c613590135;hpb=116ae6107240a49c854de2662678abb4fbb8acab;p=freeside.git diff --git a/FS/FS/part_pkg/bulk_Common.pm b/FS/FS/part_pkg/bulk_Common.pm index 26550df70..3477c444c 100644 --- a/FS/FS/part_pkg/bulk_Common.pm +++ b/FS/FS/part_pkg/bulk_Common.pm @@ -31,12 +31,12 @@ $me = '[FS::part_pkg::bulk_Common]'; sub price_info { my $self = shift; - my $str = $self->SUPER::price_info; + my $str = $self->SUPER::price_info(@_); my $svc_setup_fee = $self->option('svc_setup_fee'); my $svc_recur_fee = $self->option('svc_recur_fee'); my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; - $str .= " , bulk" if $str; + $str .= ", bulk " if $str; $str .= ": $money_char" . $svc_setup_fee . " one-time per service" if $svc_setup_fee; $str .= ", " if ($svc_setup_fee && $svc_recur_fee); @@ -47,7 +47,7 @@ sub price_info { #some false laziness-ish w/agent.pm... not a lot sub calc_recur { - my($self, $cust_pkg, $sdate, $details ) = @_; + my($self, $cust_pkg, $sdate, $details, $param ) = @_; my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; @@ -106,10 +106,13 @@ sub calc_recur { } } - sprintf('%.2f', $self->base_recur($cust_pkg, $sdate) + $total_svc_charge ); -} + my $charge = $self->base_recur($cust_pkg, $sdate) + $total_svc_charge; + + $param->{'override_charges'} = $total_svc_charge / $self->freq; + my $discount = $self->calc_discount($cust_pkg, $sdate, $details, $param); -sub can_discount { 0; } + sprintf('%.2f', $charge - $discount ); +} sub hide_svc_detail { 1; } @@ -117,5 +120,7 @@ sub is_free_options { qw( setup_fee recur_fee svc_setup_fee svc_recur_fee ); } +sub can_usageprice { 0; } + 1;