- $count_query = "SELECT COUNT(*), sum(charged), sum($owed)";
- $count_addl = [ '$%.2f total invoiced',
- '$%.2f total outstanding balance',
+ $count_query = 'SELECT COUNT(*), '. join(', ',
+ map "SUM($_)",
+ ( 'charged',
+ FS::cust_bill->net_sql,
+ FS::cust_bill->owed_sql,
+ )
+ );
+ $count_addl = [ '$%.2f invoiced (gross)',
+ '$%.2f invoiced (net)',
+ '$%.2f outstanding balance',