From: ivan Date: Sun, 1 Jun 2008 05:43:39 +0000 (+0000) Subject: add date to "applied to Invoice#" messages in history X-Git-Tag: root_of_webpay_support~616 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=103527d74c16f4427b57ce88fc9b8eeb9a79cbda add date to "applied to Invoice#" messages in history --- diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index e295ded2c..2abd8403a 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2505,6 +2505,18 @@ sub balance_due_msg { $msg; } +=item invnum_date_pretty + +Returns a string with the invoice number and date, for example: +"Invoice #54 (3/20/2008)" + +=cut + +sub invnum_date_pretty { + my $self = shift; + 'Invoice #'. $self->invnum. ' ('. time2str('%x', $self->_date). ')'; +} + sub _items_sections { my $self = shift; diff --git a/FS/FS/cust_bill_ApplicationCommon.pm b/FS/FS/cust_bill_ApplicationCommon.pm index 24274e701..803239d04 100644 --- a/FS/FS/cust_bill_ApplicationCommon.pm +++ b/FS/FS/cust_bill_ApplicationCommon.pm @@ -359,6 +359,18 @@ sub cust_bill { qsearchs( 'cust_bill', { 'invnum' => $self->invnum } ); } +=item applied_to_invoice + +Returns a string representing the invoice (see Lcust_bill->invnum_date_pretty; +} + =item lineitem_breakdown_table =cut diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 11c0d36a7..582fc8d7e 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -166,7 +166,7 @@ % && scalar(@cust_pay_refund) == 0 % && $cust_pay->unapplied == 0 ) { % #applied to one invoice, the usual situation -% $desc = ' applied to Invoice #'. $cust_bill_pay[0]->invnum; +% $desc = ' '. $cust_bill_pay[0]->applied_to_invoice; % } elsif ( scalar(@cust_bill_pay) == 0 % && scalar(@cust_pay_refund) == 1 % && $cust_pay->unapplied == 0 ) { @@ -180,7 +180,7 @@ % if ( $app->isa('FS::cust_bill_pay') ) { % $desc .= '  '. % '$'. $app->amount. -% ' applied to Invoice #'. $app->invnum. +% ' '. $app->applied_to_invoice. % '
'; % #' on '. time2str("%D", $cust_bill_pay->_date). % } elsif ( $app->isa('FS::cust_pay_refund') ) { @@ -365,7 +365,7 @@ % && scalar(@cust_credit_refund) == 0 % && $cust_credit->credited == 0 ) { % #applied to one invoice, the usual situation -% $desc = ' applied to Invoice #'. $cust_credit_bill[0]->invnum; +% $desc = ' '. $cust_credit_bill[0]->applied_to_invoice; % } elsif ( scalar(@cust_credit_bill) == 0 % && scalar(@cust_credit_refund) == 1 % && $cust_credit->credited == 0 ) { @@ -379,7 +379,7 @@ % if ( $app->isa('FS::cust_credit_bill') ) { % $desc .= '  '. % '$'. $app->amount. -% ' applied to Invoice #'. $app->invnum. +% ' '. $app->applied_to_invoice. % '
'; % #' on '. time2str("%D", $app->_date). % } elsif ( $app->isa('FS::cust_credit_refund') ) {