[freeside-commits] freeside/FS/FS AccessRight.pm, 1.11,
1.12 part_bill_event.pm, 1.24, 1.25 Schema.pm, 1.32, 1.33
Jeff Finucane,420,,
jeff at wavetail.420.am
Wed Oct 18 16:07:09 PDT 2006
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv6022/FS/FS
Modified Files:
AccessRight.pm part_bill_event.pm Schema.pm
Log Message:
suspension and cancellation reasons
Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- Schema.pm 8 Oct 2006 08:17:06 -0000 1.32
+++ Schema.pm 18 Oct 2006 23:07:06 -0000 1.33
@@ -319,6 +319,7 @@
'weight', 'int', '', '', '', '',
'plan', 'varchar', 'NULL', $char_d, '', '',
'plandata', 'text', 'NULL', '', '', '',
+ 'reason', 'int', 'NULL', '', '', '',
'disabled', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'eventpart',
@@ -650,6 +651,19 @@
'index' => [ ['custnum'], ['pkgpart'] ],
},
+ 'cust_pkg_reason' => {
+ 'columns' => [
+ 'num', 'serial', '', '', '', '',
+ 'pkgnum', 'int', '', '', '', '',
+ 'reasonnum','int', '', '', '', '',
+ 'otaker', 'varchar', '', 32, '', '',
+ 'date', @date_type, '', '',
+ ],
+ 'primary_key' => 'num',
+ 'unique' => [],
+ 'index' => [],
+ },
+
'cust_refund' => {
'columns' => [
'refundnum', 'serial', '', '', '', '',
@@ -1352,17 +1366,6 @@
'index' => [],
},
- 'cancel_reason' => {
- 'columns' => [
- 'reasonnum', 'serial', '', '', '', '',
- 'reason', 'varchar', '', $char_d, '', '',
- 'disabled', 'char', 'NULL', 1, '', '',
- ],
- 'primary_key' => 'reasonnum',
- 'unique' => [],
- 'index' => [ [ 'disabled' ] ],
- },
-
'pkg_class' => {
'columns' => [
'classnum', 'serial', '', '', '', '',
@@ -1607,7 +1610,30 @@
'index' => [ [ 'countrycode', 'phonenum' ] ],
},
- };
+ 'reason_type' => {
+ 'columns' => [
+ 'typenum', 'serial', '', '', '', '',
+ 'class', 'char', '', 1, '', '',
+ 'type', 'varchar', '', $char_d, '', '',
+ ],
+ 'primary_key' => 'typenum',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ 'reason' => {
+ 'columns' => [
+ 'reasonnum', 'serial', '', '', '', '',
+ 'reason_type', 'int', '', '', '', '',
+ 'reason', 'varchar', '', $char_d, '', '',
+ 'disabled', 'char', 'NULL', 1, '', '',
+ ],
+ 'primary_key' => 'reasonnum',
+ 'unique' => [],
+ 'index' => [],
+ },
+
+ # name type nullability length default local
#'new_table' => {
# 'columns' => [
@@ -1618,6 +1644,8 @@
# 'index' => [],
#},
+ };
+
}
=back
Index: AccessRight.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/AccessRight.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- AccessRight.pm 8 Oct 2006 08:17:06 -0000 1.11
+++ AccessRight.pm 18 Oct 2006 23:07:06 -0000 1.12
@@ -107,6 +107,8 @@
'Unsuspend customer package',
'Cancel customer package immediately',
'Cancel customer package later',
+ 'Add on-the-fly cancel reason',
+ 'Add on-the-fly suspend reason',
###
# customer service rights
Index: part_bill_event.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_bill_event.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- part_bill_event.pm 26 Aug 2006 23:15:12 -0000 1.24
+++ part_bill_event.pm 18 Oct 2006 23:07:06 -0000 1.25
@@ -60,6 +60,8 @@
=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 @@
|| $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 @@
}
}
+ my $reasonr = qsearchs('reason', {'reasonnum' => $self->reason});
+ return "Unknown reason" unless $reasonr;
+
$self->SUPER::check;
}
@@ -304,6 +310,22 @@
'';
}
+=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
More information about the freeside-commits
mailing list