RT# 82949 - changes section name from fees to pricing, better opiton
[freeside.git] / httemplate / elements / mcp_lint.html
1 % foreach my $lint (@lint) {
2 %   my $color = ( $lint =~ /unchecked$/ ? '#FF9900' : '#FF0000' );
3     <FONT COLOR="<% $color %>"><% $lint %></FONT><BR>
4 % }
5
6 <%init>
7
8 my(%opt) = @_;
9
10 my $conf = new FS::Conf;
11
12 my @svc = ();
13 if ( $opt{svc} ) {
14   @svc = ref($opt{svc}) ? @{ $opt{svc} } : ( $opt{svc} );
15 } elsif ( $opt{cust_main} ) {
16   my $custnum = $opt{cust_main}->custnum;
17   @svc = qsearchs({
18            'table'     => 'cust_svc',
19            'addl_from' => ' LEFT JOIN cust_pkg  USING ( pkgnum ) '.
20                           ' LEFT JOIN cust_main USING ( custnum )',
21            'hashref'   => { 'svcpart' => $conf->config('mcp_svcpart') },
22            'extra_sql' => " AND custnum = $custnum ",
23          });
24 } else {
25   die 'neither svc nor cust_main options passed to mcp_lint';
26 }
27
28
29 my @lint = ();
30 push @lint, 'unchecked' unless @svc;
31 foreach my $svc ( @svc ) {
32   my @svc_lint = tron_lint($svc);
33   if ( scalar(@svc) > 1 ) {
34     push @lint, map $svc->title.": $_", @svc_lint;
35   } else {
36     push @lint, @svc_lint;
37   }
38 }
39
40 </%init>