[freeside-commits] freeside/httemplate/view/cust_main
quick-charge.html, 1.2, 1.3
Ivan,,,
ivan at wavetail.420.am
Thu Oct 6 19:25:43 PDT 2005
Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail:/tmp/cvs-serv18249/httemplate/view/cust_main
Modified Files:
quick-charge.html
Log Message:
add require_taxclasses config flag
Index: quick-charge.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/quick-charge.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- quick-charge.html 12 Dec 2004 18:51:31 -0000 1.2
+++ quick-charge.html 7 Oct 2005 02:25:41 -0000 1.3
@@ -6,26 +6,43 @@
<FORM ACTION="<%=$p%>edit/process/quick-charge.cgi" METHOD="POST">
<INPUT TYPE="hidden" NAME="custnum" VALUE="<%= $cust_main->custnum %>">
Description:<INPUT TYPE="text" NAME="pkg">
- Amount:<INPUT TYPE="text" NAME="amount" SIZE=6>
- <%
+Amount:<INPUT TYPE="text" NAME="amount" SIZE=6>
+<% #false laziness w/ edit/part_pkg.cgi %>
+<% if ( $conf->exists('enable_taxclasses') ) { %>
+
+ <SELECT NAME="taxclass">
+
+ <% if ( $conf->exists('require_taxclasses') ) { %>
+
+ <OPTION VALUE="(select)">Select tax class
+
+ <% } else { %>
+
+ <OPTION VALUE="">
+
+ <% } %>
+
+ <%
+ 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};
+ my @taxclasses = grep $_, keys %taxclasses;
+ %>
- #false laziness w/ edit/part_pkg.cgi
- if ( $conf->exists('enable_taxclasses') ) {
- print '<SELECT NAME="taxclass">';
- my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
- or die dbh->errstr;
- $sth->execute or die $sth->errstr;
- foreach my $taxclass ( map $_->[0], @{$sth->fetchall_arrayref} ) {
- print qq!<OPTION VALUE="$taxclass"!;
- #print ' SELECTED' if $taxclass eq $hashref->{taxclass};
- print qq!>$taxclass</OPTION>!;
- }
- print '</SELECT>';
- } else {
- print '<INPUT TYPE="hidden" NAME="taxclass" VALUE="">';
- }
+ <% foreach my $taxclass ( @taxclasses ) { %>
+
+ <OPTION VALUE="<%= $taxclass %>"<%= 0 ? ' SELECTED' : '' %>><%= $taxclass %>
+
+ <% } %>
-%>
+ </SELECT>
+
+<% } else { %>
+
+ <INPUT TYPE="hidden" NAME="taxclass" VALUE="">';
+
+<% } %>
<INPUT TYPE="submit" VALUE="One-time charge">
</FORM>
More information about the freeside-commits
mailing list