'count_addl' => $count_addl,
'redirect' => $link,
'header' => [ emt('Invoice #'),
- emt('Gross Amount'),
+ emt($invoiced ? 'Charged' : 'Gross Amount'),
emt('Discount'),
emt('Credits'),
emt('Net Amount'),
],
'fields' => [
'display_invnum',
- 'gross',
+ $invoiced ? 'charged' : 'gross',
'discounted',
'credited',
'net',
],
'sort_fields' => [
'COALESCE( agent_invid, invnum )',
- 'gross',
+ $invoiced ? 'charged' : 'gross',
'discounted',
'credited',
'net',
my $count_addl = '';
my %search = ();
+# show invoiced amount (charged) instead of gross sales
+my $invoiced = $cgi->param('invoiced') ? 1 : 0;
+
if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) {
my $join_cust_main = FS::UI::Web::join_cust_main('cust_bill');
#scalars
for (qw( agentnum custnum cust_status refnum invnum_min invnum_max
- open net newest_percust
+ open net newest_percust invoiced
))
{