X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpkg_svc.pm;h=5c6070303e920c9ac6da69de425b3b74a83a3f88;hp=4efffd9b3d6b5e51fbdb9ac0a3f06358e3bcc317;hb=dc83512c36dc6bea2585abada4f88d714c600e55;hpb=32072dbf59a054529f5304574c0f56f9567d14d0 diff --git a/FS/FS/pkg_svc.pm b/FS/FS/pkg_svc.pm index 4efffd9b3..5c6070303 100644 --- a/FS/FS/pkg_svc.pm +++ b/FS/FS/pkg_svc.pm @@ -2,6 +2,17 @@ package FS::pkg_svc; use base qw(FS::Record); use strict; +use FS::Record qw( qsearchs ); +use FS::part_svc; + +our $cache_enabled = 0; + +sub _simplecache { + my( $self, $hashref ) = @_; + if ( $cache_enabled && $hashref->{'svc'} ) { + $self->{'_svcpart'} = FS::part_svc->new($hashref); + } +} =head1 NAME @@ -47,6 +58,8 @@ definition includes =item hidden - 'Y' to hide this service on invoices, null otherwise. +=item provision_hold - 'Y' to release package hold when all services marked with this are provisioned + =back =head1 METHODS @@ -107,6 +120,7 @@ sub check { || $self->ut_number('svcpart') || $self->ut_number('quantity') || $self->ut_enum('hidden', [ '', 'Y' ] ) + || $self->ut_flag('provision_hold') ; return $error if $error; @@ -129,6 +143,14 @@ Returns the FS::part_pkg object (see L). Returns the FS::part_svc object (see L). +=cut + +sub part_svc { + my $self = shift; + return $self->{_svcpart} if $self->{_svcpart}; + qsearchs( 'part_svc', { 'svcpart' => $self->svcpart } ); +} + =back =head1 BUGS