option to show district on 2.3 tax report, #22137
authorMark Wells <mark@freeside.biz>
Thu, 18 Apr 2013 23:45:53 +0000 (16:45 -0700)
committerMark Wells <mark@freeside.biz>
Thu, 18 Apr 2013 23:45:53 +0000 (16:45 -0700)
httemplate/search/report_tax.cgi
httemplate/search/report_tax.html

index 248f6c5..120768d 100755 (executable)
@@ -752,7 +752,12 @@ sub getlabel {
     $label = $r->country;
     $label = $r->state.", $label" if $r->state;
     $label = $r->county." county, $label" if $r->county;
-    $label = $r->city. ", $label" if $r->city && $cgi->param('show_cities');
+    if ( $cgi->param('show_cities') and $r->city ) {
+      $label = $r->city . ", $label";
+      if ( $cgi->param('show_districts') and $r->district ) {
+        $label = '#' . $r->district . ", $label";
+      }
+    }
     $label = "$label (". $r->taxclass. ")"
       if $r->taxclass
       && $cgi->param('show_taxclasses')
index 2ab0e0b..8a207aa 100755 (executable)
 
 %    if ( $city ) {
    <TR>
-     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="show_cities" VALUE="1"></TD>
+     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="show_cities" VALUE="1" onclick="toggle_show_cities(this)"></TD>
      <TD>Show cities</TD>
    </TR>
+   <TR>
+     <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="show_districts" VALUE="1" DISABLED></TD>
+     <TD>Show districts</TD>
+   </TR>
+  <SCRIPT TYPE="text/javascript">
+  function toggle_show_cities() {
+    what = document.getElementsByName('show_cities')[0];
+    what.form.show_districts.disabled = !what.checked;
+    what.form.show_districts.checked  = what.checked;
+  }
+  toggle_show_cities();
+  </SCRIPT>
 % } 
 
 %    if ( $conf->exists('enable_taxclasses') ) {