diff options
author | ivan <ivan> | 2011-10-25 22:35:14 +0000 |
---|---|---|
committer | ivan <ivan> | 2011-10-25 22:35:14 +0000 |
commit | 75769d888d9c306d5d5ccde3260c0267268cf4ed (patch) | |
tree | cbcb69b4d672826dc78064393d182e3eb7144659 /httemplate/view/cust_main | |
parent | a4c7ef67a9ca3c473c48f7176865408e619933d0 (diff) |
add legacy_cust_bill to hold legacy invoice content, RT#12981
Diffstat (limited to 'httemplate/view/cust_main')
-rw-r--r-- | httemplate/view/cust_main/payment_history.html | 9 | ||||
-rw-r--r-- | httemplate/view/cust_main/payment_history/legacy_invoice.html | 23 |
2 files changed, 32 insertions, 0 deletions
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 64a708976..752f56562 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -396,6 +396,15 @@ my %opt = ( ) ); +#legacy invoices +foreach my $legacy_cust_bill ($cust_main->legacy_cust_bill) { + push @history, { + 'date' => $legacy_cust_bill->_date, + 'desc' => include('payment_history/legacy_invoice.html', $legacy_cust_bill, %opt ), + 'charge' => $legacy_cust_bill->charged, + }; +} + #invoices foreach my $cust_bill ($cust_main->cust_bill) { push @history, { diff --git a/httemplate/view/cust_main/payment_history/legacy_invoice.html b/httemplate/view/cust_main/payment_history/legacy_invoice.html new file mode 100644 index 000000000..e999a251e --- /dev/null +++ b/httemplate/view/cust_main/payment_history/legacy_invoice.html @@ -0,0 +1,23 @@ +<% $link %><% $invoice %><% $link ? '</A>' : '' %> +<%init> + +my( $legacy_cust_bill ) = @_; #, %opt ) + +my $invoice; +if ( length($legacy_cust_bill->legacyid) ) { + $invoice = emt('Legacy Invoice #[_1]', $legacy_cust_bill->legacyid); +} else { + $invoice = emt('Legacy Invoice'); +} + +my $legacyinvnum = $legacy_cust_bill->legacyinvnum; + +my $link = ''; +if ( $FS::CurrentUser::CurrentUser->access_right('View invoices') ) { + $link = length($legacy_cust_bill->content_html) + ? qq!<A HREF="${p}view/legacy_cust_bill.html?$legacyinvnum">! + : length($legacy_cust_bill->content_pdf) + ? qq!<A HREF="${p}view/legacy_cust_bill-pdf.cgi?$legacyinvnum">! + : ''; + +</%init> |