summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2003-09-25 11:49:45 +0000
committerivan <ivan>2003-09-25 11:49:45 +0000
commitd61540138c3396a2bbcef51059f7af81ae2dd7e0 (patch)
treebab02b479b8190a2fa6faeb734fc58db9413bb62
parentbfc21bf74edda74aea0c9da61ff418bbd01ed95f (diff)
UI for multiple named taxes w/setup & recur exemptions
1.4 schema-auto-adjusting backport
-rwxr-xr-xhttemplate/browse/cust_main_county.cgi27
-rwxr-xr-xhttemplate/edit/cust_main_county.cgi36
2 files changed, 55 insertions, 8 deletions
diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi
index 991606087..e5827211c 100755
--- a/httemplate/browse/cust_main_county.cgi
+++ b/httemplate/browse/cust_main_county.cgi
@@ -21,9 +21,10 @@ print '<BR><BR>'. &table(). <<END;
<TH><FONT SIZE=-1>Country</FONT></TH>
<TH><FONT SIZE=-1>State</FONT></TH>
<TH>County</TH>
- <TH>Taxclass</TH>
+ <TH>Taxclass<BR><FONT SIZE=-1>(per-package classification)</FONT></TH>
+ <TH>Tax name<BR><FONT SIZE=-1>(printed on invoices)</FONT></TH>
<TH><FONT SIZE=-1>Tax</FONT></TH>
- <TH><FONT SIZE=-1>Exempt<BR>per<BR>month</TH>
+ <TH><FONT SIZE=-1>Exemption</TH>
</TR>
END
@@ -53,7 +54,9 @@ END
last if $hashref->{country} ne $regions[$i+$j]->country
|| $hashref->{state} ne $regions[$i+$j]->state
|| $hashref->{tax} != $regions[$i+$j]->tax
- || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount;
+ || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount
+ || $hashref->{setuptax} ne $regions[$i+$j]->setuptax
+ || $hashref->{recurtax} ne $regions[$i+$j]->recurtax;
}
my $newsup=0;
@@ -111,10 +114,22 @@ END
}
print "</TD>";
+ print "<TD";
+ if ( $hashref->{taxname} ) {
+ print ' BGCOLOR="#ffffff">'. $hashref->{taxname};
+ } else {
+ print ' BGCOLOR="#cccccc">Tax';
+ }
+ print "</TD>";
+
print "<TD BGCOLOR=\"#ffffff\">$hashref->{tax}%</TD>".
- '<TD BGCOLOR="#ffffff">$'.
- sprintf("%.2f", $hashref->{exempt_amount} || 0). '</TD>'.
- '</TR>';
+ '<TD BGCOLOR="#ffffff">';
+ print '$'. sprintf("%.2f", $hashref->{exempt_amount} ).
+ '&nbsp;per&nbsp;month<BR>'
+ if $hashref->{exempt_amount};
+ print 'Setup&nbsp;fee<BR>' if $hashref->{setuptax} =~ /^Y$/i;
+ print 'Recurring&nbsp;fee<BR>' if $hashref->{recurtax} =~ /^Y$/i;
+ print '</TD></TR>';
}
diff --git a/httemplate/edit/cust_main_county.cgi b/httemplate/edit/cust_main_county.cgi
index 7ef37a48d..efc12f3e0 100755
--- a/httemplate/edit/cust_main_county.cgi
+++ b/httemplate/edit/cust_main_county.cgi
@@ -15,12 +15,27 @@ print qq!<FORM ACTION="!, popurl(1),
<TH><FONT SIZE=-1>Country</FONT></TH>
<TH><FONT SIZE=-1>State</FONT></TH>
<TH><FONT SIZE=-1>County</FONT></TH>
- <TH><FONT SIZE=-1>Taxclass</FONT></TH>
+ <TH><FONT SIZE=-1>Taxclass</FONT><BR><FONT SIZE=-2>(per-package classification)</FONT></TH>
+END
+
+if ( dbdef->table('cust_main_county')->column('taxname') ) {
+ print '<TH><FONT SIZE=-1>Tax name</FONT><BR><FONT SIZE=-2>(printed on invoices)</FONT></TH>';
+}
+
+print <<END;
<TH><FONT SIZE=-1>Tax</FONT></TH>
<TH><FONT SIZE=-1>Exempt<BR>per<BR>month</TH>
- </TR>
END
+if ( dbdef->table('cust_main_county')->column('setuptax') ) {
+ print '<TH><FONT SIZE=-1>Setup<BR>fee<BR>exempt</TH>';
+}
+if ( dbdef->table('cust_main_county')->column('recurtax') ) {
+ print '<TH><FONT SIZE=-1>Recurring<BR>fee<BR>exempt</TH>';
+}
+
+print '</TR>';
+
foreach my $cust_main_county ( sort { $a->country cmp $b->country
or $a->state cmp $b->state
or $a->county cmp $b->county
@@ -46,10 +61,27 @@ END
: ' BGCOLOR="#cccccc">(ALL)'
, "</TD>";
+ print qq!<TD><INPUT TYPE="text" NAME="taxname!, $hashref->{taxnum},
+ qq!" VALUE="!, $hashref->{taxname}, qq!"></TD>!
+ if dbdef->table('cust_main_county')->column('taxname');
+
print qq!<TD><INPUT TYPE="text" NAME="tax!, $hashref->{taxnum},
qq!" VALUE="!, $hashref->{tax}, qq!" SIZE=6 MAXLENGTH=6>%</TD>!;
print qq!<TD>\$<INPUT TYPE="text" NAME="exempt_amount!, $hashref->{taxnum},
qq!" VALUE="!, $hashref->{exempt_amount}||0, qq!" SIZE=6></TD>!;
+
+ print qq!<TD><INPUT TYPE="checkbox" NAME="setuptax!. $hashref->{taxnum}.
+ '" VALUE="Y"'.
+ ( $hashref->{setuptax} =~ /^Y$/i ? ' CHECKED' : '' ).
+ '"></TD>'
+ if dbdef->table('cust_main_county')->column('setuptax');
+
+ print qq!<TD><INPUT TYPE="checkbox" NAME="recurtax!. $hashref->{taxnum}.
+ '" VALUE="Y"'.
+ ( $hashref->{recurtax} =~ /^Y$/i ? ' CHECKED' : '' ).
+ '"></TD>'
+ if dbdef->table('cust_main_county')->column('recurtax');
+
print '</TR>';
}