add per-customer "Invoice reports" link, RT#13802
[freeside.git] / httemplate / search / cust_bill.html
index cf6ce49..0e7f211 100755 (executable)
                    sub { time2str('%b %d %Y', shift->_date ) },
                    \&FS::UI::Web::cust_fields,
                  ],
+                 'sort_fields' => [
+                   'COALESCE( agent_invid, invnum )',
+                   FS::cust_bill->owed_sql,
+                   FS::cust_bill->net_sql,
+                   'charged',
+                   '_date',
+                 ],
                  'align' => 'rrrrl'.FS::UI::Web::cust_aligns(),
                  'links' => [
                    $link,
@@ -91,6 +98,10 @@ if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
     $search{'agentnum'} = $1;
   }
 
+  if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
+    $search{'custnum'} = $1;
+  }
+
   # begin/end/beginning/ending
   my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, '');
   $search{'_date'} = [ $beginning, $ending ]