X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=f9b36e2ec8c69dd5cf39d2a833147b2ff01eb385;hb=684a478c0f88e5bf6d1d3f32f4618089146b5709;hp=182be87ea4ae05998c400492dd935acdbda31c02;hpb=1755a73ccf8881a132ffd702471f455543871683;p=freeside.git diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 182be87ea..f9b36e2ec 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -2,7 +2,7 @@ package FS::part_pkg; use strict; use vars qw( @ISA %freq %plans $DEBUG ); -use Carp qw(carp cluck); +use Carp qw(carp cluck confess); use Tie::IxHash; use FS::Conf; use FS::Record qw( qsearch qsearchs dbh dbdef ); @@ -375,6 +375,7 @@ sub replace { next unless $old_quantity != $quantity || $old_primary_svc ne $primary_svc; my $new_pkg_svc = new FS::pkg_svc( { + 'pkgsvcnum' => ( $old_pkg_svc ? $old_pkg_svc->pkgsvcnum : '' ), 'pkgpart' => $new->pkgpart, 'svcpart' => $part_svc->svcpart, 'quantity' => $quantity, @@ -642,9 +643,15 @@ on how to create new price plans, but until then, see L. sub _rebless { my $self = shift; my $plan = $self->plan; + unless ( $plan ) { + confess "no price plan found for pkgpart ". $self->pkgpart. "\n" + if $DEBUG; + return $self; + } my $class = ref($self). "::$plan"; + warn "reblessing $self into $class" if $DEBUG; eval "use $class;"; - #die $@ if $@; + die $@ if $@; bless($self, $class) unless $@; $self; } @@ -696,6 +703,7 @@ sub calc_cancel { 0; } my %info; foreach my $INC ( @INC ) { + warn "globbing $INC/FS/part_pkg/*.pm\n" if $DEBUG; foreach my $file ( glob("$INC/FS/part_pkg/*.pm") ) { warn "attempting to load plan info from $file\n" if $DEBUG; $file =~ /\/(\w+)\.pm$/ or do {