#28898 Cisco CDR format upadate
[freeside.git] / httemplate / search / 477partIIA.html
index 95c00a3..7ccee69 100755 (executable)
@@ -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 ) {
 <PartII_<% $row + 1 %><% $cols[$col] %>>\
-<% $data[$col][$row] %>\
+<% $data[$col][$row] || 0 %>\
 </PartII_<% $row + 1 %><% $cols[$col] %>>
-%       }
 %     } #for $col
 %   } #for $row
 % } else { # HTML mode
 </TABLE>
 % } #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;
   }
 }