From e1f85eddaf46e5d2256d865aa1a5e5f21b418c94 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 5 Feb 2011 04:58:52 +0000 Subject: [PATCH] add more debug tracing to invoice generation, RT#11452 --- FS/FS/cust_bill.pm | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 58beea219..59e2bf1f3 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -4305,10 +4305,10 @@ sub _items_cust_bill_pkg { my $description = ($is_summary && $type && $type eq 'U') ? "Usage charges" : $desc; - unless ( $conf->exists('disable_line_item_date_ranges') ) { - $description .= " (" . time2str($date_format, $cust_bill_pkg->sdate). - " - ". time2str($date_format, $cust_bill_pkg->edate). ")"; - } + $description .= " (" . time2str($date_format, $cust_bill_pkg->sdate). + " - ". time2str($date_format, $cust_bill_pkg->edate). + ")" + unless $conf->exists('disable_line_item_date_ranges'); my @d = (); @@ -4325,6 +4325,9 @@ sub _items_cust_bill_pkg { || $is_summary && $type && $type eq 'U' ) { + warn "$me _items_cust_bill_pkg adding service details\n" + if $DEBUG > 1; + push @d, map &{$escape_function}($_), $cust_pkg->h_labels_short(@dates, 'I') #$cust_bill_pkg->edate, @@ -4340,8 +4343,14 @@ sub _items_cust_bill_pkg { } + warn "$me _items_cust_bill_pkg adding details\n" + if $DEBUG > 1; + push @d, $cust_bill_pkg->details(%details_opt) unless ($is_summary || $type && $type eq 'R'); + + warn "$me _items_cust_bill_pkg calculating amount\n" + if $DEBUG > 1; my $amount = 0; if (!$type) { @@ -4354,6 +4363,9 @@ sub _items_cust_bill_pkg { if ( !$type || $type eq 'R' ) { + warn "$me _items_cust_bill_pkg adding recur\n" + if $DEBUG > 1; + if ( $cust_bill_pkg->hidden ) { $r->{amount} += $amount; $r->{unit_amount} += $cust_bill_pkg->unitrecur; @@ -4372,6 +4384,9 @@ sub _items_cust_bill_pkg { } else { # $type eq 'U' + warn "$me _items_cust_bill_pkg adding usage\n" + if $DEBUG > 1; + if ( $cust_bill_pkg->hidden ) { $u->{amount} += $amount; $u->{unit_amount} += $cust_bill_pkg->unitrecur; -- 2.11.0