[freeside-commits] freeside/httemplate/edit cust_main_county-expand.cgi, 1.11.2.2, 1.11.2.3

Ivan,,, ivan at wavetail.420.am
Tue Feb 19 17:14:28 PST 2008


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

Modified Files:
      Tag: FREESIDE_1_7_BRANCH
	cust_main_county-expand.cgi 
Log Message:
oops, this got commited to HEAD by a bad command, its part of the commit to update the tax class editor to enable taxclass adding, RT#2929

Index: cust_main_county-expand.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main_county-expand.cgi,v
retrieving revision 1.11.2.2
retrieving revision 1.11.2.3
diff -u -d -r1.11.2.2 -r1.11.2.3
--- cust_main_county-expand.cgi	13 Jan 2008 21:36:07 -0000	1.11.2.2
+++ cust_main_county-expand.cgi	20 Feb 2008 01:14:26 -0000	1.11.2.3
@@ -5,7 +5,6 @@
 <FORM ACTION="<% $p1 %>process/cust_main_county-expand.cgi" METHOD=POST>
 
 <INPUT TYPE="hidden" NAME="taxnum" VALUE="<% $taxnum %>">
-<INPUT TYPE="hidden" NAME="taxclass" VALUE="<% $taxclass |h %>">
 
 <TEXTAREA NAME="expansion" COLS="50" ROWS="16"><% $expansion |h %></TEXTAREA>
 
@@ -21,17 +20,15 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
-my($taxnum, $expansion, $taxclass);
+my($taxnum, $expansion);
 my($query) = $cgi->keywords;
 if ( $cgi->param('error') ) {
   $taxnum = $cgi->param('taxnum');
   $expansion = $cgi->param('expansion');
-  $taxclass = $cgi->param('taxclass');
 } else {
-  $query =~ /^(taxclass)?(\d+)$/
+  $query =~ /^(\d+)$/
     or die "Illegal taxnum (query $query)";
-  $taxclass = $1 ? 'taxclass' : '';
-  $taxnum = $2;
+  $taxnum = $1;
   $expansion = '';
 }
 
@@ -39,28 +36,13 @@
   or die "cust_main_county.taxnum $taxnum not found";
 
 my $title;
-if ( $taxclass ) {
-  die "Can't expand entry!" if $cust_main_county->taxclass;
 
-  $title = 'Tax Classes';
+die "Can't expand entry!" if $cust_main_county->county;
 
-  # prepopuplate with other tax classes... which should really have a primary
-  #  key of their own... also this could be more efficient in the error case...
-  my $sth = dbh->prepare("SELECT DISTINCT taxclass FROM cust_main_county")
-    or die dbh->errstr;
-  $sth->execute or die $sth->errstr;
-  my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref};
-  $expansion ||= join("\n", grep $_, keys %taxclasses );
-  
+if ( $cust_main_county->state ) {
+  $title = 'Counties';
 } else {
-  die "Can't expand entry!" if $cust_main_county->county;
-
-  if ( $cust_main_county->state ) {
-    $title = 'Counties';
-  } else {
-    $title = 'States/Provinces';
-  }
-
+  $title = 'States/Provinces';
 }
 
 my $p1 = popurl(1);



More information about the freeside-commits mailing list