$self->ut_numbern('num')
|| $self->ut_number('pkgnum')
|| $self->ut_number('reasonnum')
+ || $self->ut_enum('action', [ 'A', 'C', 'E', 'S' ])
|| $self->ut_text('otaker')
|| $self->ut_numbern('date')
;
$self->SUPER::check;
}
+=item reason
+
+Returns the reason (see L<FS::reason>) associated with this cust_pkg_reason.
+
+=cut
+
+sub reason {
+ my $self = shift;
+ qsearchs( 'reason', { 'reasonnum' => $self->reasonnum } );
+}
+
+=item reasontext
+
+Returns the text of the reason (see L<FS::reason>) associated with this
+cust_pkg_reason.
+
+=cut
+
+sub reasontext {
+ my $reason = shift->reason;
+ $reason ? $reason->reason : '';
+}
+
=back
=head1 BUGS