1 <& elements/search.html,
2 'title' => 'Credit limit incidents',
3 'name_singular' => 'incident',
5 'count_query' => "SELECT COUNT(*) FROM cust_main_credit_limit",
8 #XXX should use cust_fields etc.
15 'fields' => [ sub { time2str($date_format, shift->_date); },
17 #XXX should use cust_fields etc.
18 sub { shift->cust_main->display_custnum },
19 sub { shift->cust_main->name },
21 sub { $money_char. shift->amount },
22 sub { $money_char. shift->credit_limit },
27 #XXX should use cust_fields etc.
38 unless $FS::CurrentUser::CurrentUser->access_right('List rating data');
40 my $conf = new FS::Conf;
42 my $date_format = $conf->config('date_format') || '%m/%d/%Y';
44 my $money_char = $conf->config('money_char') || '$';
46 my $cust_link = [ "${p}view/cust_main.cgi?", 'custnum' ];
48 my ($begin, $end) = FS::UI::Web::parse_beginning_ending($cgi);
49 my $dates_sql = "_date >= $begin AND _date < $end";
51 my $count_query= "SELECT COUNT(*) FROM cust_main_credit_limit WHERE $dates_sql";
54 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
56 $count_query .= " AND custnum = $1";
60 table => 'cust_main_credit_limit',
62 extra_sql => ( keys(%hash) ? ' AND ' : ' WHERE ' ). $dates_sql,
63 order_by => 'ORDER BY _date ASC',