[freeside-commits] freeside/FS/FS/cust_main Packages.pm, 1.1, 1.2 Billing.pm, 1.7, 1.8 Billing_Realtime.pm, 1.7, 1.8

Ivan,,, ivan at wavetail.420.am
Thu Sep 23 10:46:51 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/cust_main
In directory wavetail.420.am:/tmp/cvs-serv19820

Modified Files:
	Packages.pm Billing.pm Billing_Realtime.pm 
Log Message:
honor cust_main DEBUG flag, add some additional debug info, RT#10012

Index: Billing_Realtime.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Billing_Realtime.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- Billing_Realtime.pm	22 Sep 2010 20:46:38 -0000	1.7
+++ Billing_Realtime.pm	23 Sep 2010 17:46:48 -0000	1.8
@@ -89,6 +89,8 @@
 sub realtime_collect {
   my( $self, %options ) = @_;
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   if ( $DEBUG ) {
     warn "$me realtime_collect:\n";
     warn "  $_ => $options{$_}\n" foreach keys %options;
@@ -287,6 +289,8 @@
 sub realtime_bop {
   my $self = shift;
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+ 
   my %options = ();
   if (ref($_[0]) eq 'HASH') {
     %options = %{$_[0]};
@@ -712,6 +716,9 @@
 
 sub _realtime_bop_result {
   my( $self, $cust_pay_pending, $transaction, %options ) = @_;
+
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   if ( $DEBUG ) {
     warn "$me _realtime_bop_result: pending transaction ".
       $cust_pay_pending->paypendingnum. "\n";
@@ -992,6 +999,9 @@
 
 sub realtime_botpp_capture {
   my( $self, $cust_pay_pending, %options ) = @_;
+
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   if ( $DEBUG ) {
     warn "$me realtime_botpp_capture: pending transaction $cust_pay_pending\n";
     warn "  $_ => $options{$_}\n" foreach keys %options;
@@ -1147,6 +1157,8 @@
 sub realtime_refund_bop {
   my $self = shift;
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   my %options = ();
   if (ref($_[0]) eq 'HASH') {
     %options = %{$_[0]};

Index: Billing.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Billing.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- Billing.pm	22 Sep 2010 22:01:05 -0000	1.7
+++ Billing.pm	23 Sep 2010 17:46:48 -0000	1.8
@@ -306,7 +306,11 @@
 
 sub bill {
   my( $self, %options ) = @_;
+
   return '' if $self->payby eq 'COMP';
+
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   warn "$me bill customer ". $self->custnum. "\n"
     if $DEBUG;
 
@@ -431,6 +435,10 @@
 
     next unless @cust_bill_pkg; #don't create an invoice w/o line items
 
+    warn "$me billing pass $pass\n".
+           Dumper(\@cust_bill_pkg)."\n"
+      if $DEBUG > 2;
+
     if ( scalar( grep { $_->recur && $_->recur > 0 } @cust_bill_pkg) ||
            !$conf->exists('postal_invoice-recurring_only')
        )
@@ -633,9 +641,13 @@
 sub calculate_taxes {
   my ($self, $cust_bill_pkg, $taxlisthash, $invoice_time) = @_;
 
-  my @tax_line_items = ();
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
 
-  warn "having a look at the taxes we found...\n" if $DEBUG > 2;
+  warn "$me calculate_taxes\n".
+       Dumper($self, $cust_bill_pkg, $taxlisthash, $invoice_time). "\n"
+    if $DEBUG > 2;
+
+  my @tax_line_items = ();
 
   # keys are tax names (as printed on invoices / itemdesc )
   # values are listrefs of taxlisthash keys (internal identifiers)
@@ -774,6 +786,8 @@
 sub _make_lines {
   my ($self, %params) = @_;
 
+  local($DEBUG) = $cust_main::DEBUG if $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";
   my $precommit_hooks = $params{precommit_hooks} or die "no package specified";
@@ -1015,6 +1029,8 @@
   my $real_pkgpart = shift;
   my $options = shift;
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   my %cust_bill_pkg = ();
   my %taxes = ();
     
@@ -1212,6 +1228,8 @@
   my $part_pkg = shift;
   my $class = shift;
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   my @taxes = ();
   my $geocode = $self->geocode('cch');
 
@@ -1291,6 +1309,9 @@
 
 sub collect {
   my( $self, %options ) = @_;
+
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   my $invoice_time = $options{'invoice_time'} || time;
 
   #put below somehow?
@@ -1474,6 +1495,9 @@
 
 sub do_cust_event {
   my( $self, %options ) = @_;
+
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   my $time = $options{'time'} || time;
 
   #put below somehow?
@@ -1686,6 +1710,9 @@
 sub discount_term_values {
   my $self = shift;
   my $term = shift;
+
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   warn "$me discount_term_values called with $term\n" if $DEBUG;
 
   my %result = ();
@@ -1778,6 +1805,7 @@
   #my $DEBUG = $opt{'debug'}
   local($DEBUG) = $opt{'debug'}
     if defined($opt{'debug'}) && $opt{'debug'} > $DEBUG;
+  $DEBUG = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
 
   warn "$me due_cust_event called with options ".
        join(', ', map { "$_: $opt{$_}" } keys %opt). "\n"

Index: Packages.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Packages.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- Packages.pm	20 Sep 2010 20:29:31 -0000	1.1
+++ Packages.pm	23 Sep 2010 17:46:48 -0000	1.2
@@ -69,6 +69,8 @@
   my $self = shift;
   my $opt = ref($_[0]) ? shift : { @_ };
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   warn "$me order_pkg called with options ".
        join(', ', map { "$_: $opt->{$_}" } keys %$opt ). "\n"
     if $DEBUG;
@@ -187,6 +189,8 @@
   my %options = @_;
   $seconds_ref ||= $options{'seconds_ref'};
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   warn "$me order_pkgs called with options ".
        join(', ', map { "$_: $options{$_}" } keys %options ). "\n"
     if $DEBUG;
@@ -267,6 +271,8 @@
   my $self = shift;
   my $extra_qsearch = ref($_[0]) ? shift : {};
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   return $self->num_ncancelled_pkgs unless wantarray;
 
   my @cust_pkg = ();



More information about the freeside-commits mailing list