X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=3aa75eca56eed8178d0c478c8dea45606093922b;hb=8f43e32350b7f8a0925959f747f7296b9b42c09e;hp=7f6b3b9a9f2b4b5ef149f418e658ee1901a3e77f;hpb=62e88a3f8fb39a772367bd6eddfaffbdd521e1af;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 7f6b3b9a9..3aa75eca5 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2993,7 +2993,7 @@ sub print_generic { } } - unless ( $conf->exists('disable_previous_balance') + unless ( $conf->exists('disable_previous_balance', $agentnum) || $conf->exists('previous_balance-summary_only') ) { @@ -3027,7 +3027,8 @@ sub print_generic { } - if ( @pr_cust_bill && !$conf->exists('disable_previous_balance') ) { + if ( @pr_cust_bill && !$conf->exists('disable_previous_balance', $agentnum) ) + { push @buf, ['','-----------']; push @buf, [ $self->mt('Total Previous Balance'), $money_char. sprintf("%10.2f", $pr_total) ]; @@ -3143,7 +3144,7 @@ sub print_generic { $invoice_data{current_less_finance} = sprintf('%.2f', $self->charged - $invoice_data{finance_amount} ); - if ( $multisection && !$conf->exists('disable_previous_balance') + if ( $multisection && !$conf->exists('disable_previous_balance', $agentnum) || $conf->exists('previous_balance-summary_only') ) { unshift @sections, $previous_section if $pr_total; @@ -3207,7 +3208,7 @@ sub print_generic { push @buf,['','-----------']; push @buf,[$self->mt( - $conf->exists('disable_previous_balance') + $conf->exists('disable_previous_balance', $agentnum) ? 'Total Charges' : 'Total New Charges' ), @@ -3221,7 +3222,7 @@ sub print_generic { || 'Total New Charges' if $conf->exists('previous_balance-exclude_from_total'); my $amount = $self->charged + - ( $conf->exists('disable_previous_balance') || + ( $conf->exists('disable_previous_balance', $agentnum) || $conf->exists('previous_balance-exclude_from_total') ? 0 : $pr_total @@ -3248,7 +3249,7 @@ sub print_generic { push @buf,['','']; } - unless ( $conf->exists('disable_previous_balance') ) { + unless ( $conf->exists('disable_previous_balance', $agentnum) ) { #foreach my $thing ( sort { $a->_date <=> $b->_date } $self->_items_credits, $self->_items_payments # credits @@ -4992,7 +4993,7 @@ sub _items_cust_bill_pkg { ) { my $time_period; my $date_style = $conf->config('cust_bill-line_item-date_style'); - if ( $date_style eq 'month_of' ) { + if ( defined($date_style) && $date_style eq 'month_of' ) { $time_period = time2str('The month of %B', $cust_bill_pkg->sdate); } else { $time_period = time2str($date_format, $cust_bill_pkg->sdate). @@ -5260,6 +5261,9 @@ sub _items_discounts_avail { join(', ', map { "#$_" } $plan->pkgnums) if $list_pkgnums; + # discounts for non-integer months don't work anyway + $months = sprintf("%d", $months); + +{ description => $self->mt('Save [_1]% by paying for [_2] months', $percent, $months),