summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2009-10-16 22:39:02 +0000
committerivan <ivan>2009-10-16 22:39:02 +0000
commitef25e3423f6b3d939f2cfb5f35150d5da8f0251d (patch)
treef925f8ad688ead4a5a52beb4235e439a1c737964
parent4637ede67752c7fc635bfb0c78c40458af218a72 (diff)
make warning about expensive lookup a carp & controlled by $DEBUG
-rw-r--r--FS/FS/cust_bill_pkg.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/FS/FS/cust_bill_pkg.pm b/FS/FS/cust_bill_pkg.pm
index d3bdfd12a..2d32d3180 100644
--- a/FS/FS/cust_bill_pkg.pm
+++ b/FS/FS/cust_bill_pkg.pm
@@ -2,6 +2,7 @@ package FS::cust_bill_pkg;
use strict;
use vars qw( @ISA $DEBUG $me );
+use Carp;
use FS::Record qw( qsearch qsearchs dbdef dbh );
use FS::cust_main_Mixin;
use FS::cust_pkg;
@@ -18,7 +19,7 @@ use FS::cust_tax_adjustment;
@ISA = qw( FS::cust_main_Mixin FS::Record );
-$DEBUG = 2;
+$DEBUG = 1;
$me = '[FS::cust_bill_pkg]';
=head1 NAME
@@ -342,7 +343,7 @@ Returns the package (see L<FS::cust_pkg>) for this invoice line item.
sub cust_pkg {
my $self = shift;
- #warn "$me $self -> cust_pkg"; #carp?
+ carp "$me $self -> cust_pkg" if $DEBUG;
qsearchs( 'cust_pkg', { 'pkgnum' => $self->pkgnum } );
}
@@ -627,7 +628,7 @@ sub disintegrate {
#split usage from recur
my $usage = sprintf( "%.2f", $cust_bill_pkg{recur}->usage );
- warn "usage is $usage\n" if $DEBUG;
+ warn "usage is $usage\n" if $DEBUG > 1;
if ($usage) {
my $cust_bill_pkg_usage =
new FS::cust_bill_pkg { $cust_bill_pkg{recur}->hash };