projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
suspension and cancellation reasons
[freeside.git]
/
FS
/
FS
/
part_bill_event.pm
diff --git
a/FS/FS/part_bill_event.pm
b/FS/FS/part_bill_event.pm
index
473e0bd
..
3f49d29
100644
(file)
--- 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 plandata - additional plan data
+=item reason - an associated reason for this event to fire
+
=item disabled - Disabled flag, empty or `Y'
=back
=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_number('weight')
|| $self->ut_textn('plan')
|| $self->ut_anything('plandata')
+ || $self->ut_numbern('reason')
;
#|| $self->ut_snumber('seconds')
return $error if $error;
;
#|| $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;
}
$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
=back
=head1 BUGS