X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2F477partVI_census.html;h=0dafc6b21aa061411950c32add4eedb563653faa;hb=8baa8e46e67f00f297d7e10dad02c131d286f40e;hp=e283b1e3cc2c1f021c0b0ce62644fcf5720904c9;hpb=d7c50ca6ded0c72bb1b91326da3ff1d7ed45c2b0;p=freeside.git
diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html
index e283b1e3c..0dafc6b21 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',
@@ -23,8 +23,9 @@
'links' => \@links,
'url' => $opt{url} || '',
'xml_row_element' => 'Datarow',
- )
-%>
+ 'really_disable_download' => 1,
+
+&>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
@@ -74,15 +75,16 @@ 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) ) {
+for ( qw(agentnum magic state) ) {
$search_hash{$_} = $cgi->param($_) if $cgi->param($_);
}
+$search_hash{'country'} = 'US';
$search_hash{'classnum'} = [ $cgi->param('classnum') ]
if grep { $_ eq 'classnum' } $cgi->param;
@@ -115,10 +117,10 @@ foreach my $row ( @row_option ) {
);
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, censustract, $percent";
+ $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 censustract $3";
+ $sql_query->{order_by} = "$1 GROUP BY cust_location.censustract $3";
push @sql_query, $sql_query;
}
$columncount++;
@@ -131,7 +133,8 @@ my $count_query = 'SELECT count(*) FROM ( ('.
map { my $addl_from = $_->{addl_from};
my $extra_sql = $_->{extra_sql};
my $order_by = $_->{order_by};
- "SELECT censustract from cust_pkg $addl_from $extra_sql $order_by";
+ "SELECT cust_location.censustract from cust_pkg $addl_from
+ $extra_sql $order_by";
}
@sql_query
). ') ) AS foo';
@@ -158,7 +161,7 @@ my $link_suffix = sub { my $row = shift;
$result;
};
-push @links, ( [ $link, $link_suffix ] x 8 );
+for (1..8) { push @links, [ $link, $link_suffix ]; }
my $html_foot = sub {