From 027756090552715f79cd3a4de08ee73091ad99f0 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 22 Feb 2009 19:46:22 +0000 Subject: [PATCH] add h_cust_pkg and h_cust_pkg_reason packages, RT#4896 --- FS/FS/cust_pkg_reason.pm | 11 +++-------- FS/FS/h_cust_pkg.pm | 34 ++++++++++++++++++++++++++++++++++ FS/FS/h_cust_pkg_reason.pm | 34 ++++++++++++++++++++++++++++++++++ FS/MANIFEST | 5 ++++- FS/t/h_cust_pkg.t | 5 +++++ FS/t/h_cust_pkg_reason.t | 5 +++++ 6 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 FS/FS/h_cust_pkg.pm create mode 100644 FS/FS/h_cust_pkg_reason.pm create mode 100644 FS/t/h_cust_pkg.t create mode 100644 FS/t/h_cust_pkg_reason.t diff --git a/FS/FS/cust_pkg_reason.pm b/FS/FS/cust_pkg_reason.pm index 43f83d44d..403751369 100644 --- a/FS/FS/cust_pkg_reason.pm +++ b/FS/FS/cust_pkg_reason.pm @@ -134,6 +134,9 @@ sub reasontext { # # Used by FS::Upgrade to migrate to a new database. +use FS::h_cust_pkg; +use FS::h_cust_pkg_reason; + sub _upgrade_data { # class method my ($class, %opts) = @_; @@ -143,11 +146,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 } ); @@ -227,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 %action_value = ( op => 'LIKE', value => 'replace_%', diff --git a/FS/FS/h_cust_pkg.pm b/FS/FS/h_cust_pkg.pm new file mode 100644 index 000000000..e796f4145 --- /dev/null +++ b/FS/FS/h_cust_pkg.pm @@ -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, L, L, 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 index 000000000..dda200941 --- /dev/null +++ b/FS/FS/h_cust_pkg_reason.pm @@ -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, L, L, schema.html from the +base documentation. + +=cut + +1; + + diff --git a/FS/MANIFEST b/FS/MANIFEST index 796eca703..4b9fd91b5 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -74,6 +74,8 @@ FS/cust_credit_refund.pm FS/cust_svc.pm FS/h_Common.pm FS/h_cust_bill.pm +FS/h_cust_pkg.pm +FS/h_cust_pkg_reason.pm FS/h_cust_svc.pm FS/h_cust_tax_exempt.pm FS/h_domain_record.pm @@ -212,10 +214,11 @@ t/cust_pkg.t t/cust_refund.t t/cust_svc.t t/h_cust_bill.t +t/h_cust_pkg.t +t/h_cust_pkg_reason.t t/h_cust_svc.t t/h_cust_tax_exempt.t t/h_Common.t -t/h_cust_svc.t t/h_domain_record.t t/h_svc_acct.t t/h_svc_broadband.t diff --git a/FS/t/h_cust_pkg.t b/FS/t/h_cust_pkg.t new file mode 100644 index 000000000..16a8a5d26 --- /dev/null +++ b/FS/t/h_cust_pkg.t @@ -0,0 +1,5 @@ +BEGIN { $| = 1; print "1..1\n" } +END {print "not ok 1\n" unless $loaded;} +use FS::h_cust_pkg; +$loaded=1; +print "ok 1\n"; diff --git a/FS/t/h_cust_pkg_reason.t b/FS/t/h_cust_pkg_reason.t new file mode 100644 index 000000000..b8dae92cf --- /dev/null +++ b/FS/t/h_cust_pkg_reason.t @@ -0,0 +1,5 @@ +BEGIN { $| = 1; print "1..1\n" } +END {print "not ok 1\n" unless $loaded;} +use FS::h_cust_pkg_reason; +$loaded=1; +print "ok 1\n"; -- 2.11.0