backport history packages
authorjeff <jeff>
Mon, 16 Mar 2009 00:34:51 +0000 (00:34 +0000)
committerjeff <jeff>
Mon, 16 Mar 2009 00:34:51 +0000 (00:34 +0000)
FS/FS/cust_pkg_reason.pm
FS/FS/h_cust_pkg.pm [new file with mode: 0644]
FS/FS/h_cust_pkg_reason.pm [new file with mode: 0644]

index 1eaa43a..bb0542b 100644 (file)
@@ -134,8 +134,8 @@ sub reasontext {
 #
 # Used by FS::Upgrade to migrate to a new database.
 
-#use FS::h_cust_pkg;
-#use FS::h_cust_pkg_reason;
+use FS::h_cust_pkg;
+use FS::h_cust_pkg_reason;
 use FS::Schema qw(dbdef);
 
 sub _upgrade_data { # class method
@@ -149,11 +149,6 @@ sub _upgrade_data { # class method
   my $count = 0;
   my @unmigrated = qsearch('cust_pkg_reason', { 'action' => '' } ); 
   foreach ( @unmigrated ) {
-    # we could create h_cust_pkg_reason and h_cust_pkg_reason packages
-    @FS::h_cust_pkg::ISA = qw( FS::h_Common FS::cust_pkg );
-    sub FS::h_cust_pkg::table { 'h_cust_pkg' };
-    @FS::h_cust_pkg_reason::ISA = qw( FS::h_Common FS::cust_pkg_reason );
-    sub FS::h_cust_pkg_reason::table { 'h_cust_pkg_reason' };
 
     my @history_cust_pkg_reason = qsearch( 'h_cust_pkg_reason', { $_->hash } );
     
@@ -230,9 +225,6 @@ sub _upgrade_data { # class method
                                extra_sql => $extra_sql,
                             }); 
     foreach ( @unmigrated ) {
-      # we could create h_cust_pkg_reason and h_cust_pkg_reason packages
-      @FS::h_cust_pkg::ISA = qw( FS::h_Common FS::cust_pkg );
-      sub FS::h_cust_pkg::table { 'h_cust_pkg' };
 
       my $hashref = { pkgnum => $_->pkgnum,
                       history_date   => $_->date,
diff --git a/FS/FS/h_cust_pkg.pm b/FS/FS/h_cust_pkg.pm
new file mode 100644 (file)
index 0000000..e796f41
--- /dev/null
@@ -0,0 +1,34 @@
+package FS::h_cust_pkg;
+
+use strict;
+use vars qw( @ISA );
+use FS::h_Common;
+use FS::cust_pkg;
+
+@ISA = qw( FS::h_Common FS::cust_pkg );
+
+sub table { 'h_cust_pkg' };
+
+=head1 NAME
+
+FS::h_cust_pkg - Historical record of customer package changes
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+An FS::h_cust_pkg object represents historical changes to packages.
+FS::h_cust_pkg inherits from FS::h_Common and FS::cust_pkg.
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::cust_pkg>,  L<FS::h_Common>, L<FS::Record>, schema.html from the base
+documentation.
+
+=cut
+
+1;
+
+
diff --git a/FS/FS/h_cust_pkg_reason.pm b/FS/FS/h_cust_pkg_reason.pm
new file mode 100644 (file)
index 0000000..dda2009
--- /dev/null
@@ -0,0 +1,34 @@
+package FS::h_cust_pkg_reason;
+
+use strict;
+use vars qw( @ISA );
+use FS::h_Common;
+use FS::cust_pkg_reason;
+
+@ISA = qw( FS::h_Common FS::cust_pkg_reason );
+
+sub table { 'h_cust_pkg_reason' };
+
+=head1 NAME
+
+FS::h_cust_pkg_reason - Historical record of customer package changes
+
+=head1 SYNOPSIS
+
+=head1 DESCRIPTION
+
+An FS::h_cust_pkg_reason object represents historical changes to packages.
+FS::h_cust_pkg_reason inherits from FS::h_Common and FS::cust_pkg_reason.
+
+=head1 BUGS
+
+=head1 SEE ALSO
+
+L<FS::cust_pkg_reason>,  L<FS::h_Common>, L<FS::Record>, schema.html from the
+base documentation.
+
+=cut
+
+1;
+
+