X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=efb1b59ab271d233e714658b9051fc5c626a79d0;hb=546fd20829df7ab53dd60b6f7589058789acd77f;hp=1b887a2f09ead7202d4dfaf9a1b4035adff567d1;hpb=6ef0d344462736b9bc1782caccc6305f946632c7;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 1b887a2f0..efb1b59ab 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -16,11 +16,13 @@ use FS::type_pkgs; use FS::part_pkg_option; use FS::pkg_class; use FS::agent; +use FS::part_pkg_msgcat; use FS::part_pkg_taxrate; use FS::part_pkg_taxoverride; use FS::part_pkg_taxproduct; use FS::part_pkg_link; use FS::part_pkg_discount; +use FS::part_pkg_usage; use FS::part_pkg_vendor; @ISA = qw( FS::m2m_Common FS::option_Common ); @@ -714,6 +716,22 @@ sub propagate { join("\n", @error); } +=item pkg_locale LOCALE + +Returns a customer-viewable string representing this package for the given +locale, from the part_pkg_msgcat table. If no localized string is found, +returns the base pkg field. + +=cut + +sub pkg_locale { + my( $self, $locale ) = @_; + my $part_pkg_msgcat = qsearchs( 'part_pkg_msgcat', { pkgpart=>$self->pkgpart, + locale =>$locale }) + or return $self->pkg; + $part_pkg_msgcat->pkg; +} + =item pkg_comment [ OPTION => VALUE... ] Returns an (internal) string representing this package. Currently, @@ -1397,6 +1415,18 @@ sub part_pkg_discount { qsearch('part_pkg_discount', { 'pkgpart' => $self->pkgpart }); } +=item part_pkg_usage + +Returns the voice usage pools (see L) defined for +this package. + +=cut + +sub part_pkg_usage { + my $self = shift; + qsearch('part_pkg_usage', { 'pkgpart' => $self->pkgpart }); +} + =item _rebless Reblesses the object into the FS::part_pkg::PLAN class (if available), where