[freeside-commits] branch FREESIDE_3_BRANCH updated. 77ffd5cb8c802e43cad458e859ef9c035d3b39f0
Christopher Burger
burgerc at freeside.biz
Tue Jun 19 08:46:05 PDT 2018
The branch, FREESIDE_3_BRANCH has been updated
via 77ffd5cb8c802e43cad458e859ef9c035d3b39f0 (commit)
from c6edebe2dfd2ede484ee89ed03b5b14b13e7b507 (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 77ffd5cb8c802e43cad458e859ef9c035d3b39f0
Author: Christopher Burger <burgerc at freeside.biz>
Date: Thu Dec 21 12:31:40 2017 -0500
RT# 29974 - Added ability to show invoice_pay_by_message on total new charges line rather than balance due line
Conflicts:
FS/FS/cust_bill.pm
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 5cc2f05a9..39495f778 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2026,6 +2026,23 @@ sub due_date2str {
$self->due_date ? $self->time2str_local(shift, $self->due_date) : '';
}
+=item invoice_pay_by_msg
+
+ displays the invoice_pay_by_msg or default Please pay by [_1] if empty.
+
+=cut
+
+sub invoice_pay_by_msg {
+ my $self = shift;
+ my $msg = '';
+ my $please_pay_by =
+ $self->conf->config('invoice_pay_by_msg', $self->agentnum)
+ || 'Please pay by [_1]';
+ $msg .= ' - ' . $self->mt($please_pay_by, $self->due_date2str('short')) . ' ';
+
+ $msg;
+}
+
=item balance_due_msg
=cut
@@ -2040,11 +2057,7 @@ sub balance_due_msg {
# _items_total) and not here
# (yes, or if invoice_sections is enabled; this is just for compatibility)
if ( $self->due_date ) {
- my $please_pay_by =
- $self->conf->config('invoice_pay_by_msg', $self->agentnum)
- || 'Please pay by [_1]';
- $msg .= ' - ' . $self->mt($please_pay_by, $self->due_date2str('short')).
- ' '
+ $msg .= $self->invoice_pay_by_msg
unless $self->conf->config_bool('invoice_omit_due_date',$self->agentnum);
} elsif ( $self->terms ) {
$msg .= ' - '. $self->mt($self->terms);
diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm
index 6bfe3339a..2d937a827 100644
--- a/FS/FS/cust_bill.pm
+++ b/FS/FS/cust_bill.pm
@@ -2925,15 +2925,11 @@ sub _items_total {
}
}
-
- if ( $conf->exists('invoice_show_prior_due_date') ) {
+ if ( $conf->exists('invoice_show_prior_due_date') && !$conf->exists('invoice_omit_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');
+ $new_charges_desc .= $self->invoice_pay_by_msg;
} elsif ( $self->terms ) {
# phrases like "due on receipt" should be localized
$new_charges_desc .= ' - ' . $self->mt($self->terms);
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Template_Mixin.pm | 23 ++++++++++++++++++-----
FS/FS/cust_bill.pm | 8 ++------
2 files changed, 20 insertions(+), 11 deletions(-)
More information about the freeside-commits
mailing list