use strict;
use FS::Record qw( qsearch qsearchs );
+use FS::olt_site;
=head1 NAME
=item serial - serial number
+=item sitenum - the L<FS::olt_site> where this OLT is installed
+
=item disabled - set to 'Y' to make this OLT unavailable for new connections
=back
$self->ut_numbern('oltnum')
|| $self->ut_text('oltname')
|| $self->ut_text('serial')
+ || $self->ut_foreign_keyn('sitenum', 'olt_site', 'sitenum')
|| $self->ut_flag('disabled')
;
return $error if $error;
$self->SUPER::check;
}
+=item site_description
+
+Returns the OLT's site description.
+
+=cut
+
+sub site_description {
+ my $self = shift;
+ return '' if !$self->sitenum;
+ my $olt_site = FS::olt_site->by_key($self->sitenum);
+ return $olt_site->description;
+}
+
+=item description
+
+Returns the OLT's site name and unit name.
+
+=cut
+
+sub description {
+ my $self = shift;
+ my $desc = $self->oltname;
+ $desc = $self->site_description . '/' . $desc if $self->sitenum;
+ return $desc;
+}
+
=back
=head1 SEE ALSO
-L<FS::svc_fiber>, L<FS::Record>
+L<FS::svc_fiber>, L<FS::olt_site>, L<FS::Record>
=cut