- 'title' => emt('Invoice Search Results'),
- 'html_init' => $html_init,
- 'menubar' => $menubar,
- 'name' => 'invoices',
- 'query' => $sql_query,
- 'count_query' => $count_query,
- 'count_addl' => $count_addl,
- 'redirect' => $link,
- 'header' => [ emt('Invoice #'),
- emt('Balance'),
- emt('Net Amount'),
- emt('Gross Amount'),
- emt('Date'),
- FS::UI::Web::cust_header(),
- ],
- 'fields' => [
- 'display_invnum',
- sub { sprintf($money_char.'%.2f', shift->get('owed') ) },
- sub { sprintf($money_char.'%.2f', shift->get('net') ) },
- sub { sprintf($money_char.'%.2f', shift->charged ) },
- 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,
- $link,
- $link,
- $link,
- $link,
- ( map { $_ ne 'Cust. Status' ? $clink : '' }
- FS::UI::Web::cust_header()
- ),
- ],
- 'color' => [
- '',
- '',
- '',
- '',
- '',
- FS::UI::Web::cust_colors(),
- ],
- 'style' => [
- '',
- '',
- '',
- '',
- '',
- FS::UI::Web::cust_styles(),
- ],
+ 'title' => emt('Invoice Search Results'),
+ 'html_init' => $html_init,
+ 'menubar' => $menubar,
+ 'name' => 'invoices',
+ 'query' => $sql_query,
+ 'count_query' => $count_query,
+ 'count_addl' => $count_addl,
+ 'redirect' => $link,
+ 'header' => [ emt('Invoice #'),
+ emt($invoiced ? 'Charged' : 'Gross Amount'),
+ emt('Discount'),
+ emt('Credits'),
+ emt('Net Amount'),
+ emt('Balance'),
+ emt('Date'),
+ FS::UI::Web::cust_header(),
+ ],
+ 'fields' => [
+ 'display_invnum',
+ $invoiced ? 'charged' : 'gross',
+ 'discounted',
+ 'credited',
+ 'net',
+ 'owed',
+ sub { time2str('%b %d %Y', shift->_date ) },
+ \&FS::UI::Web::cust_fields,
+ ],
+ 'sort_fields' => [
+ 'COALESCE( agent_invid, invnum )',
+ $invoiced ? 'charged' : 'gross',
+ 'discounted',
+ 'credited',
+ 'net',
+ 'owed',
+ '_date',
+ ],
+ 'format' => [
+ '',
+ $money_char.'%.2f',
+ $money_char.'%.2f',
+ $money_char.'%.2f',
+ $money_char.'%.2f',
+ $money_char.'%.2f',
+ '',
+ ],
+ 'align' => 'rrrrrrl'.FS::UI::Web::cust_aligns(),
+ 'links' => [
+ $link,
+ $link,
+ $link,
+ $link,
+ $link,
+ $link,
+ $link,
+ ( map { $_ ne 'Cust. Status' ? $clink : '' }
+ FS::UI::Web::cust_header()
+ ),
+ ],
+ 'color' => [
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ FS::UI::Web::cust_colors(),
+ ],
+ 'style' => [
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ '',
+ FS::UI::Web::cust_styles(),
+ ],