my $sql_query = {
'table' => 'cust_main',
'hashref' => {},
- 'select' => "*, $owed_cols, $packages_cols",
+ 'select' => join(',',
+ #'cust_main.*',
+ 'custnum',
+ $owed_cols,
+ $packages_cols,
+ FS::UI::Web::cust_sql_fields(),
+ ),
'extra_sql' => $where,
'order_by' => "order by coalesce(lower(company), ''), lower(last)",
};
$start = $start ? "( $str2time now() $closing - ".($start * 86400). ' )' : '';
$end = $end ? "( $str2time now() $closing - ".($end * 86400). ' )' : '';
- #$opt{'unapplied_date'} = 1;
+ $opt{'unapplied_date'} = 1;
( $opt{sum} ? 'SUM( ' : '' ).
FS::cust_main->balance_date_sql( $start, $end, %opt ).