per-agent disable_previous_balance, #15863
[freeside.git] / FS / FS / cust_bill_pkg_detail.pm
index b8af013..46f6e17 100644 (file)
@@ -55,6 +55,10 @@ inherits from FS::Record.  The following fields are currently supported:
 
 =item phonenum -
 
+=item accountcode - accountcode
+
+=item startdate - CDR startdate, if any
+
 =item detail - detail description
 
 =back
@@ -137,6 +141,7 @@ sub check {
     || $self->ut_enum('format', [ '', 'C' ] )
     || $self->ut_numbern('duration')
     || $self->ut_textn('regionname')
+    || $self->ut_textn('accountcode')
     || $self->ut_text('detail')
     || $self->ut_foreign_keyn('classnum', 'usage_class', 'classnum')
     || $self->$phonenum_check_method('phonenum')
@@ -158,11 +163,13 @@ for tabular appearance in those environments if possible.
 If I<escape_function> is set then the format is processed by this
 function before being returned.
 
+DEPRECATED? (mostly unused, expensive)
 If I<format_function> is set then the detail is handed to this callback
 for processing.
 
 =cut
 
+#totally false laziness w/cust_bill_pkg->detail
 sub formatted {
   my ( $self, %opt ) = @_;
   my $format = $opt{format} || '';
@@ -238,7 +245,10 @@ sub _upgrade_schema { # class method
 
   warn "$me upgrading $class\n" if $DEBUG;
 
-  my $type = dbdef->table($class->table)->column('classnum')->type;
+  my $classnum = dbdef->table($class->table)->column('classnum')
+    or return;
+
+  my $type = $classnum->type;
   unless ( $type =~ /^int/i || $type =~ /int$/i ) {
 
     my $dbh = dbh;