From bfcd05f8ead55f8ef1a6c05d410ebe8cf791409c Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 5 Feb 2011 04:41:08 +0000 Subject: [PATCH] add more debug tracing to invoice generation, RT#11452 --- FS/FS/cust_bill.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 91cdcda07..33490c951 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -4179,7 +4179,7 @@ sub _items_tax { sub _items_cust_bill_pkg { my $self = shift; - my $cust_bill_pkg = shift; + my $cust_bill_pkgs = shift; my %opt = @_; my $format = $opt{format} || ''; @@ -4194,9 +4194,12 @@ sub _items_cust_bill_pkg { my @b = (); my ($s, $r, $u) = ( undef, undef, undef ); - foreach my $cust_bill_pkg ( @$cust_bill_pkg ) + foreach my $cust_bill_pkg ( @$cust_bill_pkgs ) { + warn "$me _items_cust_bill_pkg considering cust_bill_pkg $cust_bill_pkg\n" + if $DEBUG > 1; + $discount_show_always = ($cust_bill_pkg->cust_bill_pkg_discount && $conf->exists('discount-show-always')); @@ -4221,6 +4224,9 @@ sub _items_cust_bill_pkg { ) { + warn "$me _items_cust_bill_pkg considering display item $display\n" + if $DEBUG > 1; + my $type = $display->type; my $desc = $cust_bill_pkg->desc; @@ -4234,6 +4240,9 @@ sub _items_cust_bill_pkg { if ( $cust_bill_pkg->pkgnum > 0 ) { + warn "$me _items_cust_bill_pkg cust_bill_pkg is non-tax\n" + if $DEBUG > 1; + my $cust_pkg = $cust_bill_pkg->cust_pkg; if ( $cust_bill_pkg->setup != 0 && (!$type || $type eq 'S') ) { @@ -4379,6 +4388,9 @@ sub _items_cust_bill_pkg { } else { #pkgnum tax or one-shot line item (??) + warn "$me _items_cust_bill_pkg cust_bill_pkg is tax\n" + if $DEBUG > 1; + if ( $cust_bill_pkg->setup != 0 ) { push @b, { 'description' => $desc, @@ -4400,6 +4412,9 @@ sub _items_cust_bill_pkg { } + warn "$me _items_cust_bill_pkg done considering cust_bill_pkgs\n" + if $DEBUG > 1; + foreach ( $s, $r, ($opt{skip_usage} ? () : $u ) ) { if ( $_ ) { $_->{amount} = sprintf( "%.2f", $_->{amount} ), -- 2.11.0