[freeside-commits] freeside/httemplate/browse tax_rate.cgi, 1.3, 1.4

Jeff Finucane,420,, jeff at wavetail.420.am
Wed Jul 23 07:36:17 PDT 2008


Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv11645/httemplate/browse

Modified Files:
	tax_rate.cgi 
Log Message:
add disabled column to new tax rates, false laziness elimination, and bug fixes - closes #3566

Index: tax_rate.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/tax_rate.cgi,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- tax_rate.cgi	18 Jun 2008 18:50:44 -0000	1.3
+++ tax_rate.cgi	23 Jul 2008 14:36:15 -0000	1.4
@@ -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_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 @@
               '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 @@
     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 = '';
 



More information about the freeside-commits mailing list