diff options
author | jeff <jeff> | 2006-10-18 23:07:08 +0000 |
---|---|---|
committer | jeff <jeff> | 2006-10-18 23:07:08 +0000 |
commit | 52281cbeaf8d4e02345eca3c1aa0500133823558 (patch) | |
tree | c0174e1f4b9fb952c7976db92d464b74d82cf11f /FS/FS/part_bill_event.pm | |
parent | 609fe46a015c92be8a93c1b05a2fb67133bfd22b (diff) |
suspension and cancellation reasons
Diffstat (limited to 'FS/FS/part_bill_event.pm')
-rw-r--r-- | FS/FS/part_bill_event.pm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/FS/FS/part_bill_event.pm b/FS/FS/part_bill_event.pm index 473e0bd..3f49d29 100644 --- a/FS/FS/part_bill_event.pm +++ b/FS/FS/part_bill_event.pm @@ -60,6 +60,8 @@ FS::Record. The following fields are currently supported: =item plandata - additional plan data +=item reason - an associated reason for this event to fire + =item disabled - Disabled flag, empty or `Y' =back @@ -161,6 +163,7 @@ sub check { || $self->ut_number('weight') || $self->ut_textn('plan') || $self->ut_anything('plandata') + || $self->ut_numbern('reason') ; #|| $self->ut_snumber('seconds') return $error if $error; @@ -184,6 +187,9 @@ sub check { } } + my $reasonr = qsearchs('reason', {'reasonnum' => $self->reason}); + return "Unknown reason" unless $reasonr; + $self->SUPER::check; } @@ -304,6 +310,22 @@ sub do_event { ''; } +=item reasontext + +Returns the text of any reason associated with this event. + +=cut + +sub reasontext { + my $self = shift; + my $r = qsearchs('reason', { 'reasonnum' => $self->reason }); + if ($r){ + $r->reason; + }else{ + ''; + } +} + =back =head1 BUGS |