X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg%2Fcurrency_fixed.pm;h=d4c14878644fff69ca9f39350906a72d88557018;hp=ce7145278bddcab077a549498d0af115d18d0ec6;hb=02d73ef84103d6bdaf49e6a179a0ad46f9719d25;hpb=b7a2175dd9b386441f4ab66869d73083e5e8beb1 diff --git a/FS/FS/part_pkg/currency_fixed.pm b/FS/FS/part_pkg/currency_fixed.pm index ce7145278..d4c148786 100644 --- a/FS/FS/part_pkg/currency_fixed.pm +++ b/FS/FS/part_pkg/currency_fixed.pm @@ -33,30 +33,31 @@ use FS::currency_exchange; sub price_info { my $self = shift; - my $str = $self->SUPER::price_info; + my $str = $self->SUPER::price_info(@_); $str .= " (or local currency pricing)" if $str; $str; } sub base_setup { - my($self, $cust_pkg, $sdate, $details, $param ) = @_; + my($self, $cust_pkg, $time, $details, $param ) = @_; - $self->calc_currency_option('setup_fee', $cust_pkg, $sdate, $details, $param); + $self->calc_currency_option('setup_fee', $cust_pkg, $time, $details, $param); } 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); - $self->base_setup($cust_pkg, $sdate, $details, $param); + $self->base_setup($cust_pkg, $time, $details, $param); } use FS::Conf; sub calc_currency_option { - my($self, $optionname, $cust_pkg, $sdate, $details, $param) = @_; + my($self, $optionname, $cust_or_quotation_pkg, $time, $details, $param) = @_; - my($currency, $amount) = $cust_pkg->part_pkg_currency_option($optionname); + my($currency, $amount) = + $cust_or_quotation_pkg->part_pkg_currency_option($optionname); return sprintf('%.2f', $amount ) unless $currency; $param->{'billed_currency'} = $currency; @@ -73,21 +74,27 @@ sub calc_currency_option { } sub base_recur { - my( $self, $cust_pkg, $sdate, $details, $param ) = @_; - $param ||= {}; - $self->calc_currency_option('recur_fee', $cust_pkg, $sdate, $details, $param); + my( $self, $cust_or_quotation_pkg, $sdate, $details, $param ) = @_; + $self->calc_currency_option( + 'recur_fee', $cust_or_quotation_pkg, $sdate, $details, $param || {} + ); } sub can_discount { 0; } #can't discount yet (percentage would work, but amount?) sub calc_recur { my $self = shift; + #my($cust_pkg, $sdate, $details, $param ) = @_; - #$self->calc_recur_Common($cust_pkg,$sdate,$details,$param); - $self->calc_recur_Common(@_); + my $cust_pkg = $_[0]; + + ($cust_pkg->quantity || 1) * $self->calc_recur_Common(@_); #($cust_pkg,$sdate,$details,$param); + } sub is_free { 0; } sub can_currency_exchange { 1; } +sub can_usageprice { 0; } + 1;