diff options
| author | Christopher Burger <burgerc@freeside.biz> | 2017-12-21 12:31:40 -0500 |
|---|---|---|
| committer | Christopher Burger <burgerc@freeside.biz> | 2018-06-19 12:01:09 -0400 |
| commit | 697a391b0449e62b593a6cd4931aa457d9a0c45d (patch) | |
| tree | deac5e2bedf9784a67f4716dee388b24d33fb341 /FS | |
| parent | d6854fbb7a94e8be85d2d66aea2328e6e4bc9725 (diff) | |
RT# 29974 - Added ability to show invoice_pay_by_message on total new charges line rather than balance due line
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/Template_Mixin.pm | 23 | ||||
| -rw-r--r-- | FS/FS/cust_bill.pm | 9 |
2 files changed, 20 insertions, 12 deletions
diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index 37bc98923..653e69891 100644 --- a/FS/FS/Template_Mixin.pm +++ b/FS/FS/Template_Mixin.pm @@ -2040,6 +2040,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 @@ -2054,11 +2071,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 ec6e3d341..52c62af2d 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -3444,17 +3444,12 @@ sub _items_total { $total_descr = $self->mt('Total Charges'); } - 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 ) { - $total_descr = join(' ', - $total_descr, - '-', - $self->mt('Please pay by'), - $self->due_date2str('short') - ); + $total_descr .= $self->invoice_pay_by_msg; } elsif ( $self->terms ) { $total_descr = join(' ', $total_descr, |
