X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fbilling.html;h=828fbd3c4d3425865e9d6e244f085764ee1a55be;hb=0ec4177b088852a185b88ce3e9941a3ecbc2cb59;hp=01e7654d1bb536789fddb8287abf062bfef3e319;hpb=326bd8efd1a7ec6b4d2624f9c8e25811404ed6db;p=freeside.git diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 01e7654d1..828fbd3c4 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -23,7 +23,7 @@ <% $balance %> -% #54: just an arbitrary number i pulled out of my goober. in reality we'd want +% #54: just an arbitrary number i pulled out of my goober. ideally we'd like % # to consider e.g. a histogram of num_ncancelled_packages for the entire % # customer base, and compare it to a graph of the overhead for generating this % # information. (and optimize it better, we could get it more from SQL) @@ -61,9 +61,11 @@ % || $cust_pkg->option('no_suspend_bill') % ); % +% my $pkg_amount = 0; +% % #add recurring amounts for this package and its billing add-ons % foreach my $l_part_pkg ( $part_pkg->self_and_bill_linked ) { -% $amount += $l_part_pkg->option('recur_fee'); +% $pkg_amount += $l_part_pkg->base_recur; % } % % #subtract amounts for any active discounts @@ -71,15 +73,19 @@ % foreach my $cust_pkg_discount ( $cust_pkg->cust_pkg_discount_active ) { % my $discount = $cust_pkg_discount->discount; % #and only one of these for each -% $amount -= $discount->amount; -% $amount -= $amount * $discount->percent/100; +% $pkg_amount -= $discount->amount; +% $pkg_amount -= $amount * $discount->percent/100; % } % +% $pkg_amount *= ( $cust_pkg->quantity || 1 ); +% +% $amount += $pkg_amount; +% % } - <% emt( ucfirst($freq_pretty). ' recurring' ) %> - <% $money_char. sprintf('%.2f', $amount) %> + <% emt( ucfirst($freq_pretty). ' recurring' ) %> + <% $money_char. sprintf('%.2f', $amount) %> % }