X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=2cfd0909af45d802b0884d6bdc183bc3fd771358;hb=3ad0080229de463ef00f26ce384729f3303360ad;hp=32c2cb1a85bdb8055b6f9d4b2b875e1e706ed7b6;hpb=d04a3f3b11ab9e1d32ffb328bf994e8f21fc51a1;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 32c2cb1a8..2cfd0909a 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -4468,6 +4468,21 @@ sub _items_cust_bill_pkg { foreach my $cust_bill_pkg ( @$cust_bill_pkgs ) { + foreach ( $s, $r, ($opt{skip_usage} ? () : $u ) ) { + if ( $_ && !$cust_bill_pkg->hidden ) { + $_->{amount} = sprintf( "%.2f", $_->{amount} ), + $_->{amount} =~ s/^\-0\.00$/0.00/; + $_->{unit_amount} = sprintf( "%.2f", $_->{unit_amount} ), + push @b, { %$_ } + if $_->{amount} != 0 + || $discount_show_always + || ( ! $_->{_is_setup} && $_->{recur_show_zero} ) + || ( $_->{_is_setup} && $_->{setup_show_zero} ) + ; + $_ = undef; + } + } + warn "$me _items_cust_bill_pkg considering cust_bill_pkg ". $cust_bill_pkg->billpkgnum. ", pkgnum ". $cust_bill_pkg->pkgnum. "\n" if $DEBUG > 1; @@ -4482,7 +4497,8 @@ sub _items_cust_bill_pkg { ) { - warn "$me _items_cust_bill_pkg considering display item $display\n" + warn "$me _items_cust_bill_pkg considering cust_bill_pkg_display ". + $display->billpkgdisplaynum. "\n" if $DEBUG > 1; my $type = $display->type; @@ -4551,6 +4567,7 @@ sub _items_cust_bill_pkg { #pkgpart => $part_pkg->pkgpart, pkgnum => $cust_bill_pkg->pkgnum, amount => $cust_bill_pkg->setup, + setup_show_zero => $cust_bill_pkg->setup_show_zero, unit_amount => $cust_bill_pkg->unitsetup, quantity => $cust_bill_pkg->quantity, ext_description => \@d, @@ -4657,6 +4674,7 @@ sub _items_cust_bill_pkg { #pkgpart => $part_pkg->pkgpart, pkgnum => $cust_bill_pkg->pkgnum, amount => $amount, + recur_show_zero => $cust_bill_pkg->recur_show_zero, unit_amount => $cust_bill_pkg->unitrecur, quantity => $cust_bill_pkg->quantity, ext_description => \@d, @@ -4678,6 +4696,7 @@ sub _items_cust_bill_pkg { #pkgpart => $part_pkg->pkgpart, pkgnum => $cust_bill_pkg->pkgnum, amount => $amount, + recur_show_zero => $cust_bill_pkg->recur_show_zero, unit_amount => $cust_bill_pkg->unitrecur, quantity => $cust_bill_pkg->quantity, ext_description => \@d, @@ -4715,33 +4734,20 @@ sub _items_cust_bill_pkg { $discount_show_always = ($cust_bill_pkg->cust_bill_pkg_discount && $conf->exists('discount-show-always')); - foreach ( $s, $r, ($opt{skip_usage} ? () : $u ) ) { - if ( $_ && !$cust_bill_pkg->hidden ) { - $_->{amount} = sprintf( "%.2f", $_->{amount} ), - $_->{amount} =~ s/^\-0\.00$/0.00/; - $_->{unit_amount} = sprintf( "%.2f", $_->{unit_amount} ), - push @b, { %$_ } - if $_->{amount} != 0 - || $discount_show_always - || ( ! $_->{_is_setup} && $cust_bill_pkg->recur_show_zero ) - || ( $_->{_is_setup} && $cust_bill_pkg->setup_show_zero ) - ; - $_ = undef; - } - } - } - #foreach ( $s, $r, ($opt{skip_usage} ? () : $u ) ) { - # if ( $_ ) { - # $_->{amount} = sprintf( "%.2f", $_->{amount} ), - # $_->{amount} =~ s/^\-0\.00$/0.00/; - # $_->{unit_amount} = sprintf( "%.2f", $_->{unit_amount} ), - # push @b, { %$_ } - # if $_->{amount} != 0 - # || $discount_show_always - # } - #} + foreach ( $s, $r, ($opt{skip_usage} ? () : $u ) ) { + if ( $_ ) { + $_->{amount} = sprintf( "%.2f", $_->{amount} ), + $_->{amount} =~ s/^\-0\.00$/0.00/; + $_->{unit_amount} = sprintf( "%.2f", $_->{unit_amount} ), + push @b, { %$_ } + if $_->{amount} != 0 + || $discount_show_always + || ( ! $_->{_is_setup} && $_->{recur_show_zero} ) + || ( $_->{_is_setup} && $_->{setup_show_zero} ) + } + } warn "$me _items_cust_bill_pkg done considering cust_bill_pkgs\n" if $DEBUG > 1; @@ -5082,6 +5088,11 @@ sub search_sql_where { push @search, "cust_main.agentnum = $1"; } + #agentnum + if ( $param->{'custnum'} =~ /^(\d+)$/ ) { + push @search, "cust_bill.custnum = $1"; + } + #_date if ( $param->{_date} ) { my($beginning, $ending) = @{$param->{_date}};