X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Ftax_rate.cgi;h=cb997fada6842686e772e3c68b192e349a57c270;hp=71cfb28ac3a3933957ef4b93c91aae128ddb53fc;hb=877a4eb85cb847bd314d6a9192fedb1dc35c5d02;hpb=8e026f7a5e492cdc9d1d2792453b27f60fc31e03 diff --git a/httemplate/browse/tax_rate.cgi b/httemplate/browse/tax_rate.cgi index 71cfb28ac..cb997fada 100755 --- a/httemplate/browse/tax_rate.cgi +++ b/httemplate/browse/tax_rate.cgi @@ -1,24 +1,21 @@ <% include( 'elements/browse.html', - 'title' => "Tax Rates $title", - 'name_singular' => 'tax rate', - 'menubar' => \@menubar, - 'html_init' => $html_init, - 'html_form' => $html_form, - 'query' => { - 'table' => 'tax_rate', - 'hashref' => $hashref, - 'order_by' => 'ORDER BY geocode, taxclassnum', - 'extra_sql' => $extra_sql, - }, - 'count_query' => $count_query, - 'header' => \@header, - 'header2' => \@header2, - 'fields' => \@fields, - 'align' => $align, - 'color' => \@color, - 'cell_style' => \@cell_style, - 'links' => \@links, - 'link_onclicks' => \@link_onclicks, + 'title' => "Tax Rates $title", + 'name_singular' => 'tax rate', + 'menubar' => \@menubar, + 'html_init' => $html_init, + 'html_form' => $html_form, + 'disableable' => 1, + 'disabled_statuspos' => 5, + 'query' => $query, + 'count_query' => $count_query, + 'header' => \@header, + 'header2' => \@header2, + 'fields' => \@fields, + 'align' => $align, + 'color' => \@color, + 'cell_style' => \@cell_style, + 'links' => \@links, + 'link_onclicks' => \@link_onclicks, ) %> <%once> @@ -156,7 +153,6 @@ my $tax_type = $1 my $tax_cat = $1 if ( $cgi->param('tax_cat') =~ /^(\d+)$/ ); -my @taxclassnum = (); if ($tax_type || $tax_cat ) { my $compare = "LIKE '". ( $tax_type || "%" ). ":". ( $tax_cat || "%" ). "'"; $compare = "= '$tax_type:$tax_cat'" if ($tax_type && $tax_cat); @@ -166,7 +162,6 @@ if ($tax_type || $tax_cat ) { 'extra_sql' => "WHERE taxclass $compare", }); if (@tax_class) { - @taxclassnum = map { $_->taxclassnum } @tax_class; $tax_class[0]->description =~ /^(.*):(.*)/; $title .= " for"; $title .= " $tax_type ($1) tax type" if $tax_type; @@ -208,28 +203,7 @@ my $html_form = include('/elements/init_overlib.html'). '

'. qw(disable enable) ); -my $hashref = {}; -my $extra_sql = ''; -if ( $data_vendor ) { - $extra_sql .= ' WHERE data_vendor = '. dbh->quote($data_vendor); -} - -if ( $geocode ) { - $extra_sql .= ( $extra_sql =~ /WHERE/i ? ' AND ' : ' WHERE ' ). - ' geocode LIKE '. dbh->quote($geocode.'%'); -} - -if ( $taxclassnum ) { - $extra_sql .= ( $extra_sql =~ /WHERE/i ? ' AND ' : ' WHERE ' ). - ' taxclassnum = '. dbh->quote($taxclassnum); -} - -if ( @taxclassnum ) { - $extra_sql .= ( $extra_sql =~ /WHERE/i ? ' AND ' : ' WHERE ' ). - join(' OR ', map { " taxclassnum = $_ " } @taxclassnum ); -} - -my $count_query = "SELECT COUNT(*) FROM tax_rate $extra_sql"; +my ($query, $count_query) = FS::tax_rate::browse_queries(scalar($cgi->Vars)); $cell_style = '';