X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=22e8828d6d702e207ecfd2ee40ac7b9b9e59f7c7;hb=e497261817ee2cf3acb5ee3dda3c5906f1c13a4f;hp=67372ac6433e63c4c4d7b90622f3ce753b53bb8a;hpb=e96a2a6fd3a8885b0fb035ecc55bdf50dbe5a4aa;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 67372ac64..22e8828d6 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -1076,6 +1076,8 @@ sub can_discount { 0; } sub can_start_date { 1; } +sub can_currency_exchange { 0; } + sub freqs_href { # moved to FS::Misc to make this accessible to other packages # at initialization @@ -1270,6 +1272,28 @@ sub part_pkg_currency_options { map { $_->optionname => $_->optionvalue } $self->part_pkg_currency(shift); } +=item part_pkg_currency_option CURRENCY OPTIONNAME + +Returns the option value for the given name and currency. + +=cut + +sub part_pkg_currency_option { + my( $self, $currency, $optionname ) = @_; + my $part_pkg_currency = + qsearchs('part_pkg_currency', { 'pkgpart' => $self->pkgpart, + 'currency' => $currency, + 'optionname' => $optionname, + } + )#; + #fatal if not found? that works for our use cases from + #part_pkg/currency_fixed, but isn't how we would typically/expect the method + #to behave. have to catch it there if we change it here... + or die "Unknown price for ". $self->pkg_comment. " in $currency\n"; + + $part_pkg_currency->optionvalue; +} + =item bill_part_pkg_link Returns the associated part_pkg_link records (see L).