promised payment date for invoices, #13554
[freeside.git] / httemplate / view / cust_main / payment_history.html
index 580a307..63708e6 100644 (file)
 %
 %  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,6 +398,17 @@ 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
 foreach my $cust_bill ($cust_main->cust_bill) {
   push @history, {
@@ -507,15 +520,13 @@ 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' ) {
         my( $account, $aba ) = split('@', $object->paymask );
-        if ( $conf->exists('echeck-no_routing') ) {
-          $payinfo = emt("Acct #[_1]", $account);
-        } else {
-          $payinfo = emt("ABA [_1], Acct #[_2]",$aba,$account);
-        }
+        $payinfo = emt("ABA [_1], Acct #[_2]",$aba,$account);
     }
 
     ($payby,$payinfo);