X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2F477partVI_census.html;h=b4f6ddc01d059c847c5fcadb3c6743e593b31853;hp=8425c4b48789bdfd5975ea753cf81d09c79c2b24;hb=e9e0cf0989259b94d9758eceff448666a2e5a5cc;hpb=0af38652da3b3be7da2d35b048285ef6f2194e1a
diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html
index 8425c4b48..b4f6ddc01 100755
--- a/httemplate/search/477partVI_census.html
+++ b/httemplate/search/477partVI_census.html
@@ -1,4 +1,4 @@
-<% include( 'elements/search.html',
+<& elements/search.html,
'html_init' => '
Part VI
',
'html_foot' => $html_foot,
'name' => 'regions',
@@ -24,8 +24,8 @@
'url' => $opt{url} || '',
'xml_row_element' => 'Datarow',
'really_disable_download' => 1,
- )
-%>
+
+&>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
@@ -75,15 +75,17 @@ push @fields,
$state_pkgcount{$state} += $row->quantity;
$row->quantity;
},
- sub { my $row = shift; sprintf "%.2f", $row->residential },
+ sub { my $row = shift; sprintf "%.3f", $row->residential },
;
my %search_hash = ();
my @sql_query = ();
-for ( qw(agentnum magic state) ) {
+for ( qw(agentnum state) ) {
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);
}
+
+$search_hash{'active'} = [ $opt{date}, $opt{date} ];
$search_hash{'country'} = 'US';
$search_hash{'classnum'} = [ $cgi->param('classnum') ]
if grep { $_ eq 'classnum' } $cgi->param;
@@ -115,12 +117,11 @@ foreach my $row ( @row_option ) {
($report_option ? ( 'report_option' => $report_option ) : () ),
}
);
+warn Dumper($sql_query) if $rowcount==1 and $columncount==3;
my $extracolumns = "$rowcount AS upload, $columncount AS download, $tech_code as technology_code";
my $percent = "CASE WHEN count(*) > 0 THEN 100-100*cast(count(cust_main.company) as numeric)/cast(count(*) as numeric) ELSE cast(0 as numeric) END AS residential";
$sql_query->{select} = "count(*) AS quantity, $extracolumns, cust_location.censustract, $percent";
- $sql_query->{order_by} =~ /^(.*)(ORDER BY pkgnum)(.*)$/s
- or die "couldn't parse order_by";
- $sql_query->{order_by} = "$1 GROUP BY cust_location.censustract $3";
+ $sql_query->{order_by} = " GROUP BY cust_location.censustract ";
push @sql_query, $sql_query;
}
$columncount++;