X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill_event.pm;h=f631987aac9981362c7832a7725d1a66e7b814a4;hb=e9af247503b619f0c61a3ba14481bc76752bdd8b;hp=987e53e4b215bd884c5b955e251870dc5f78d178;hpb=ddd6429bd05b2854c88b734d859c659de5faf4c6;p=freeside.git diff --git a/FS/FS/cust_bill_event.pm b/FS/FS/cust_bill_event.pm index 987e53e4b..f631987aa 100644 --- a/FS/FS/cust_bill_event.pm +++ b/FS/FS/cust_bill_event.pm @@ -107,7 +107,7 @@ sub check { || $self->ut_number('invnum') || $self->ut_number('eventpart') || $self->ut_number('_date') - || $self->ut_enum('status', [qw( done failed )] + || $self->ut_enum('status', [qw( done failed )]) || $self->ut_textn('statustext') ; @@ -132,6 +132,32 @@ sub part_bill_event { qsearchs( 'part_bill_event', { 'eventpart' => $self->eventpart } ); } +=item cust_bill + +Returns the invoice (see L) for this completed invoice event. + +=cut + +sub cust_bill { + my $self = shift; + qsearchs( 'cust_bill', { 'invnum' => $self->invnum } ); +} + +=item retry + +Changes the status of this event from B to B, allowing it to be +retried. + +=cut + +sub retry { + my $self = shift; + return '' unless $self->status eq 'done'; + my $old = ref($self)->new( { $self->hash } ); + $self->status('failed'); + $self->replace($old); +} + =back =head1 BUGS