X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2F477partIIA.html;h=7ccee692865b847e942232184c192317400bb840;hb=08db5f6900bb754efb597a2967adde4dbd12e731;hp=95c00a3e06fc340986d950f4d26107f08319c6b7;hpb=f3e0ac2b009c4edd5692cb587ff709dac2223ebe;p=freeside.git diff --git a/httemplate/search/477partIIA.html b/httemplate/search/477partIIA.html index 95c00a3e0..7ccee6928 100755 --- a/httemplate/search/477partIIA.html +++ b/httemplate/search/477partIIA.html @@ -2,11 +2,9 @@ % my @cols = qw(a b c d); % for ( my $row = 0; $row < scalar(@rows); $row++ ) { % for my $col (0..3) { -% if ( exists($data[$col][$row]) and $data[$col][$row] > 0 ) { <% $cols[$col] %>>\ -<% $data[$col][$row] %>\ +<% $data[$col][$row] || 0 %>\ <% $cols[$col] %>> -% } % } #for $col % } #for $row % } else { # HTML mode @@ -40,25 +38,25 @@ % } #XML/HTML <%init> - my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('List packages'); +my %opt = @_; my %search_hash = (); $search_hash{'agentnum'} = $cgi->param('agentnum'); $search_hash{'state'} = $cgi->param('state'); $search_hash{'classnum'} = [ $cgi->param('classnum') ]; -$search_hash{'status'} = 'active'; +$search_hash{'active'} = [ $opt{date}, $opt{date} ]; my @row_option; foreach ($cgi->param('part2a_row_option')) { push @row_option, (/^\d+$/ ? $_ : undef); } -my $is_residential = "AND COALESCE(cust_main.company, '') = ''"; +my $is_residential = " AND COALESCE(cust_main.company, '') = ''"; my $has_report_option = sub { map { defined($row_option[$_]) ? @@ -104,7 +102,7 @@ if ( $total_lines > 0 ) { foreach (@row_conds) { my $sql = $query_ds0 . $_; my $lines = FS::Record->scalar_sql($sql); - my $percent = sprintf('%.2f', 100 * $lines / $total_lines); + my $percent = sprintf('%.3f', 100 * $lines / $total_lines); push @{ $data[0] }, $percent; } }