use strict;
use vars qw( @ISA $DEBUG );
use FS::Record qw( qsearch qsearchs );
+use FS::cust_main_Mixin;
use FS::cust_bill;
use FS::part_bill_event;
-@ISA = qw(FS::Record);
+@ISA = qw(FS::cust_main_Mixin FS::Record);
$DEBUG = 0;
sub table { 'cust_bill_event'; }
+sub cust_linked { $_[0]->cust_main_custnum; }
+sub cust_unlinked_msg {
+ my $self = shift;
+ "WARNING: can't find cust_main.custnum ". $self->custnum.
+ ' (cust_bill.invnum '. $self->invnum. ')';
+}
+
=item insert
Adds this record to the database. If there is an error, returns the error,
|| $self->ut_textn('statustext')
;
+ return "Unknown eventpart ". $self->eventpart
+ unless my $part_bill_event =
+ qsearchs( 'part_bill_event' ,{ 'eventpart' => $self->eventpart } );
+
return "Unknown invnum ". $self->invnum
unless qsearchs( 'cust_bill' ,{ 'invnum' => $self->invnum } );
- return "Unknown eventpart ". $self->eventpart
- unless qsearchs( 'part_bill_event' ,{ 'eventpart' => $self->eventpart } );
-
$self->SUPER::check;
}
$self->replace($old);
}
+=item retryable
+
+Changes the statustext of this event to B<retriable>, rendering it
+retriable (should retry be called).
+
+=cut
+
+sub retriable {
+ my $self = shift;
+ return '' unless $self->status eq 'done';
+ my $old = ref($self)->new( { $self->hash } );
+ $self->statustext('retriable');
+ $self->replace($old);
+}
+
=back
=head1 SUBROUTINES