From 4bbf4035783020c31df0358980ca54de5893851d Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 23 Sep 2010 17:55:15 +0000 Subject: [PATCH] honor cust_main DEBUG flag, add some additional debug info, RT#10012 --- FS/FS/cust_main/Billing.pm | 18 +++++++++--------- FS/FS/cust_main/Billing_Realtime.pm | 10 +++++----- FS/FS/cust_main/Packages.pm | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/FS/FS/cust_main/Billing.pm b/FS/FS/cust_main/Billing.pm index 96ffe41f4..3638d00f2 100644 --- a/FS/FS/cust_main/Billing.pm +++ b/FS/FS/cust_main/Billing.pm @@ -309,7 +309,7 @@ sub bill { return '' if $self->payby eq 'COMP'; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; warn "$me bill customer ". $self->custnum. "\n" if $DEBUG; @@ -641,7 +641,7 @@ jurisdictions (i.e. Texas) have tax exemptions which are date sensitive. sub calculate_taxes { my ($self, $cust_bill_pkg, $taxlisthash, $invoice_time) = @_; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; warn "$me calculate_taxes\n". Dumper($self, $cust_bill_pkg, $taxlisthash, $invoice_time). "\n" @@ -786,7 +786,7 @@ sub calculate_taxes { sub _make_lines { my ($self, %params) = @_; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; my $part_pkg = $params{part_pkg} or die "no part_pkg specified"; my $cust_pkg = $params{cust_pkg} or die "no cust_pkg specified"; @@ -1029,7 +1029,7 @@ sub _handle_taxes { my $real_pkgpart = shift; my $options = shift; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; my %cust_bill_pkg = (); my %taxes = (); @@ -1228,7 +1228,7 @@ sub _gather_taxes { my $part_pkg = shift; my $class = shift; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; my @taxes = (); my $geocode = $self->geocode('cch'); @@ -1310,7 +1310,7 @@ Debugging level. Default is 0 (no debugging), or can be set to 1 (passed-in opt sub collect { my( $self, %options ) = @_; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; my $invoice_time = $options{'invoice_time'} || time; @@ -1496,7 +1496,7 @@ Debugging level. Default is 0 (no debugging), or can be set to 1 (passed-in opt sub do_cust_event { my( $self, %options ) = @_; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; my $time = $options{'time'} || time; @@ -1711,7 +1711,7 @@ sub discount_term_values { my $self = shift; my $term = shift; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; warn "$me discount_term_values called with $term\n" if $DEBUG; @@ -1805,7 +1805,7 @@ sub due_cust_event { #my $DEBUG = $opt{'debug'} local($DEBUG) = $opt{'debug'} if defined($opt{'debug'}) && $opt{'debug'} > $DEBUG; - $DEBUG = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + $DEBUG = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; warn "$me due_cust_event called with options ". join(', ', map { "$_: $opt{$_}" } keys %opt). "\n" diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm index 46d531af8..212407518 100644 --- a/FS/FS/cust_main/Billing_Realtime.pm +++ b/FS/FS/cust_main/Billing_Realtime.pm @@ -89,7 +89,7 @@ I allows payment capture to unlock export jobs sub realtime_collect { my( $self, %options ) = @_; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; if ( $DEBUG ) { warn "$me realtime_collect:\n"; @@ -289,7 +289,7 @@ my %bop_method2payby = ( sub realtime_bop { my $self = shift; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; my %options = (); if (ref($_[0]) eq 'HASH') { @@ -717,7 +717,7 @@ sub fake_bop { sub _realtime_bop_result { my( $self, $cust_pay_pending, $transaction, %options ) = @_; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; if ( $DEBUG ) { warn "$me _realtime_bop_result: pending transaction ". @@ -1000,7 +1000,7 @@ upon success) and session_id of any associated session. sub realtime_botpp_capture { my( $self, $cust_pay_pending, %options ) = @_; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; if ( $DEBUG ) { warn "$me realtime_botpp_capture: pending transaction $cust_pay_pending\n"; @@ -1157,7 +1157,7 @@ gateway is attempted. sub realtime_refund_bop { my $self = shift; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; my %options = (); if (ref($_[0]) eq 'HASH') { diff --git a/FS/FS/cust_main/Packages.pm b/FS/FS/cust_main/Packages.pm index 103b9435b..316ae3750 100644 --- a/FS/FS/cust_main/Packages.pm +++ b/FS/FS/cust_main/Packages.pm @@ -69,7 +69,7 @@ sub order_pkg { my $self = shift; my $opt = ref($_[0]) ? shift : { @_ }; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; warn "$me order_pkg called with options ". join(', ', map { "$_: $opt->{$_}" } keys %$opt ). "\n" @@ -189,7 +189,7 @@ sub order_pkgs { my %options = @_; $seconds_ref ||= $options{'seconds_ref'}; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; warn "$me order_pkgs called with options ". join(', ', map { "$_: $options{$_}" } keys %options ). "\n" @@ -271,7 +271,7 @@ sub ncancelled_pkgs { my $self = shift; my $extra_qsearch = ref($_[0]) ? shift : {}; - local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG; + local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG; return $self->num_ncancelled_pkgs unless wantarray; -- 2.11.0