projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d596deb
)
fix bug that could cause mis-billing on upgrades! (new installs ok)
author
ivan
<ivan>
Mon, 8 Nov 2004 09:16:14 +0000
(09:16 +0000)
committer
ivan
<ivan>
Mon, 8 Nov 2004 09:16:14 +0000
(09:16 +0000)
FS/FS/part_pkg.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_pkg.pm
b/FS/FS/part_pkg.pm
index
67c7c96
..
5063936
100644
(file)
--- 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 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 );
use Tie::IxHash;
use FS::Conf;
use FS::Record qw( qsearch qsearchs dbh dbdef );
@@
-454,13
+454,18
@@
Returns the option value for the given name, or the empty string.
=cut
sub option {
=cut
sub option {
- my
$self = shift
;
+ my
( $self, $opt ) = @_
;
my $part_pkg_option =
qsearchs('part_pkg_option', {
pkgpart => $self->pkgpart,
my $part_pkg_option =
qsearchs('part_pkg_option', {
pkgpart => $self->pkgpart,
- optionname =>
shif
t,
+ optionname =>
$op
t,
} );
} );
- $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
}
=item _rebless