X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history.html;h=b5b71619929b6ccdcd3368fad36750e626ddf4eb;hb=83f70978574fef3401020cb11cf651d12c139b3b;hp=fa9c166972aa0fb5e35882f13af7049f934c60ba;hpb=c52f1b6999b57cc3cb52fe8e4304d0bbfbbbb2f2;p=freeside.git diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index fa9c16697..b5b716199 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -123,8 +123,14 @@ -%# invoice reports +%# invoice reports, combined statement % if ( $curuser->access_right('List invoices') ) { +% if ( $conf->exists('cust_main-print_statement_link') +% and $num_cust_bill > 0 ) { + <% + mt('Print a current statement') |h %> +
+% } <% mt('Invoice reports') |h %> % }
@@ -267,7 +273,9 @@ % % my $charge = exists($item->{'charge'}) % ? sprintf("$money_char\%.2f", $item->{'charge'}) -% : ''; +% : exists($item->{'charge_nobal'}) +% ? sprintf("$money_char\%.2f", $item->{'charge_nobal'}) +% : ''; % % my $payment = exists($item->{'payment'}) % ? sprintf("- $money_char\%.2f", $item->{'payment'}) @@ -396,13 +404,26 @@ my %opt = ( ) ); +$opt{'date_format'} ||= '%m/%d/%Y'; + +#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_nobal' => $legacy_cust_bill->charged, + }; +} + #invoices +my $num_cust_bill = 0; foreach my $cust_bill ($cust_main->cust_bill) { push @history, { 'date' => $cust_bill->_date, 'desc' => include('payment_history/invoice.html', $cust_bill, %opt ), 'charge' => $cust_bill->charged, }; + $num_cust_bill++; } #statements @@ -507,6 +528,8 @@ sub translate_payinfo { my $payby = $object->payby; my $payinfo = $object->payinfo; + my $conf = new FS::Conf; + if ( $payby eq 'CARD' ) { $payinfo = $object->paymask; } elsif ( $payby eq 'CHEK' ) {