+=item cust_note_class
+
+Returns the customer note class, as an FS::cust_note_class object, or the empty
+string if there is no note class.
+
+=cut
+
+sub cust_note_class {
+ my $self = shift;
+ if ( $self->classnum ) {
+ qsearchs('cust_note_class', { 'classnum' => $self->classnum } );
+ } else {
+ return '';
+ }
+}
+
+=item classname
+
+Returns the customer note class name, or the empty string if there is no
+customer note class.
+
+=cut
+
+sub classname {
+ my $self = shift;
+ my $cust_note_class = $self->cust_note_class;
+ $cust_note_class ? $cust_note_class->classname : '';
+}
+
+
+#false laziness w/otaker_Mixin & cust_attachment
+sub otaker {
+ my $self = shift;
+ if ( scalar(@_) ) { #set
+ my $otaker = shift;
+ my($l,$f) = (split(', ', $otaker));
+ my $access_user = qsearchs('access_user', { 'username'=>$otaker } )
+ || qsearchs('access_user', { 'first'=>$f, 'last'=>$l } )
+ or croak "can't set otaker: $otaker not found!"; #confess?
+ $self->usernum( $access_user->usernum );
+ $otaker; #not sure return is used anywhere, but just in case
+ } else { #get
+ if ( $self->usernum ) {
+ $self->access_user->username;
+ } elsif ( length($self->get('otaker')) ) {
+ $self->get('otaker');
+ } else {
+ '';
+ }
+ }
+}
+
+# Used by FS::Upgrade to migrate to a new database.
+sub _upgrade_data { # class method
+ my ($class, %opts) = @_;
+ $class->_upgrade_otaker(%opts);
+}
+