add Excel and CSV download of templated reports and clean up their HTML formatting...
[freeside.git] / httemplate / search / cust_bill.html
index 3ae624a..440e468 100755 (executable)
        : '';
    };
 
-%>
-<%= include( 'elements/search.html',
-               'title'       => 'Invoice Search Results',
-               'name'        => 'invoices',
-               'query'       => $sql_query,
-               'count_query' => $count_query,
-               'count_addl'  => [ '$%.2f total invoiced',
-                                  '$%.2f total outstanding balance',
-                                ],
-               'redirect'    => $link,
-               'header'      =>
-                 [ 'Invoice #', qw(Balance Amount Date), 'Contact name',
-                   'Company' ],
-               'fields'      => [
-                 'invnum',
-                 sub { sprintf('$%.2f', shift->get('owed') ) },
-                 sub { sprintf('$%.2f', shift->charged     ) },
-                 sub { time2str('%b %d %Y', shift->_date ) },
-                 sub { my $cust_bill = shift;
-                       my $cust_main = $cust_bill->cust_main;
-                       $cust_main
-                         ? $cust_main->get('last'). ', '. $cust_main->first
-                         : "WARNING: can't find cust_main.custnum ".
-                           $cust_bill->custnum. ' (cust_bill.invnum '.
-                           $cust_bill->invnum. ')';
-                     },
-                 sub { my $cust_main = shift->cust_main;
-                       $cust_main ? $cust_main->company : '';
-                     },
-               ],
-               'links' => [
-                 $link,
-                 $link,
-                 $link,
-                 $link,
-                 $clink,
-                 $clink,
-               ],
-
-    )
+%><%= include( 'elements/search.html',
+                 'title'       => 'Invoice Search Results',
+                 'name'        => 'invoices',
+                 'query'       => $sql_query,
+                 'count_query' => $count_query,
+                 'count_addl'  => [ '$%.2f total invoiced',
+                                    '$%.2f total outstanding balance',
+                                  ],
+                 'redirect'    => $link,
+                 'header'      =>
+                   [ 'Invoice #', qw(Balance Amount Date), 'Contact name',
+                     'Company' ],
+                 'fields'      => [
+                   'invnum',
+                   sub { sprintf('$%.2f', shift->get('owed') ) },
+                   sub { sprintf('$%.2f', shift->charged     ) },
+                   sub { time2str('%b %d %Y', shift->_date ) },
+                   sub { my $cust_bill = shift;
+                         my $cust_main = $cust_bill->cust_main;
+                         $cust_main
+                           ? $cust_main->get('last'). ', '. $cust_main->first
+                           : "WARNING: can't find cust_main.custnum ".
+                             $cust_bill->custnum. ' (cust_bill.invnum '.
+                             $cust_bill->invnum. ')';
+                       },
+                   sub { my $cust_main = shift->cust_main;
+                         $cust_main ? $cust_main->company : '';
+                       },
+                 ],
+                 'links' => [
+                   $link,
+                   $link,
+                   $link,
+                   $link,
+                   $clink,
+                   $clink,
+                 ],
+  
+      )
 %>