fix detaching w/cust_main-require_phone, RT#25987
[freeside.git] / FS / FS / contact_phone.pm
index 0eb2166..610753f 100644 (file)
@@ -4,6 +4,7 @@ use base qw( FS::Record );
 use strict;
 use FS::Record qw( qsearch qsearchs );
 use FS::contact;
+use FS::phone_type;
 
 =head1 NAME
 
@@ -144,6 +145,16 @@ sub contact {
   qsearchs( 'contact', { 'contactnum' => $self->contactnum } );
 }
 
+sub phone_type {
+  my $self = shift;
+  qsearchs('phone_type', { 'phonetypenum' => $self->phonetypenum } );
+}
+
+sub typename {
+  my $self = shift;
+  $self->phone_type->typename;
+}
+
 =back
 
 =head1 BUGS