[freeside-commits] branch FREESIDE_3_BRANCH updated. 0369284202cb5f0beeaf8a829ac98db925422e75
Mark Wells
mark at 420.am
Tue Apr 14 13:32:33 PDT 2015
The branch, FREESIDE_3_BRANCH has been updated
via 0369284202cb5f0beeaf8a829ac98db925422e75 (commit)
from e60646b3956c63646261e4f96341cf6cef477466 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 0369284202cb5f0beeaf8a829ac98db925422e75
Author: Mark Wells <mark at freeside.biz>
Date: Tue Apr 14 13:31:55 2015 -0700
fix for previous
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index df9711c..0de124c 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -2862,6 +2862,8 @@ sub _items_total {
my @items;
my ($pr_total) = $self->previous;
+ my ($new_charges_desc, $new_charges_amount);
+
if ( $conf->exists('previous_balance-exclude_from_total') ) {
# then return separate lines for previous balance and total new charges
if ( $pr_total ) {
@@ -2870,36 +2872,39 @@ sub _items_total {
total_amount => sprintf('%.2f',$pr_total)
};
}
- my $new_charges_desc = $self->mt(
+ $new_charges_desc = $self->mt(
$conf->config('previous_balance-exclude_from_total')
|| 'Total New Charges'
); # localize 'Total New Charges' or whatever's in the config
- if ( $conf->exists('invoice_show_prior_due_date') ) {
- # then the due date should be shown with Total New Charges,
- # and should NOT be shown with the Balance Due message.
- if ( $self->due_date ) {
- # localize the "Please pay by" message and the date itself
- # (grammar issues with this, yeah)
- $new_charges_desc .= ' - ' . $self->mt('Please pay by') . ' ' .
- $self->due_date2str('short');
- } elsif ( $self->terms ) {
- # phrases like "due on receipt" should be localized
- $new_charges_desc .= ' - ' . $self->mt($self->terms);
- }
- }
-
- push @items,
- { total_item => $self->mt($new_charges_desc),
- total_amount => $self->charged
- };
+ $new_charges_amount = $self->charged;
} else {
- push @items,
- { total_item => $self->mt('Total Charges'),
- total_amount => sprintf('%.2f',$self->charged + $pr_total)
- };
+
+ $new_charges_desc = $self->mt('Total Charges');
+ $new_charges_amount = sprintf('%.2f',$self->charged + $pr_total);
+
+ }
+
+ if ( $conf->exists('invoice_show_prior_due_date') ) {
+ # then the due date should be shown with Total New Charges,
+ # and should NOT be shown with the Balance Due message.
+ if ( $self->due_date ) {
+ # localize the "Please pay by" message and the date itself
+ # (grammar issues with this, yeah)
+ $new_charges_desc .= ' - ' . $self->mt('Please pay by') . ' ' .
+ $self->due_date2str('short');
+ } elsif ( $self->terms ) {
+ # phrases like "due on receipt" should be localized
+ $new_charges_desc .= ' - ' . $self->mt($self->terms);
+ }
}
+
+ push @items,
+ { total_item => $new_charges_desc,
+ total_amount => $new_charges_amount,
+ };
+
@items;
}
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cust_bill.pm | 51 ++++++++++++++++++++++++++++-----------------------
1 file changed, 28 insertions(+), 23 deletions(-)
More information about the freeside-commits
mailing list