freeside/FS/FS part_pkg.pm,1.26,1.27
ivan
ivan at pouncequick.420.am
Mon Nov 8 01:16:17 PST 2004
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory pouncequick:/tmp/cvs-serv24460/FS/FS
Modified Files:
part_pkg.pm
Log Message:
fix bug that could cause mis-billing on upgrades! (new installs ok)
Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- part_pkg.pm 26 Oct 2004 11:26:33 -0000 1.26
+++ part_pkg.pm 8 Nov 2004 09:16:14 -0000 1.27
@@ -2,7 +2,7 @@
use strict;
use vars qw( @ISA %freq %plans $DEBUG );
-use Carp;
+use Carp qw(cluck);
use Tie::IxHash;
use FS::Conf;
use FS::Record qw( qsearch qsearchs dbh dbdef );
@@ -454,13 +454,18 @@
=cut
sub option {
- my $self = shift;
+ my( $self, $opt ) = @_;
my $part_pkg_option =
qsearchs('part_pkg_option', {
pkgpart => $self->pkgpart,
- optionname => shift,
+ optionname => $opt,
} );
- $part_pkg_option ? $part_pkg_option->optionvalue : '';
+ return $part_pkg_option->optionvalue if $part_pkg_option;
+ my %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
+ split("\n", $self->plandata );
+ return $plandata{$opt} if exists $plandata{$opt};
+ cluck "Package definition option $opt not found in options or plandata!\n";
+ '';
}
=item _rebless
More information about the freeside-commits
mailing list