From 8965012fa53fd05d851d2f5abed4e056ab758797 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 21 Sep 2002 11:17:39 +0000 Subject: all taxes now have names. closes: Bug#15 --- httemplate/browse/cust_main_county.cgi | 11 ++++++++++- httemplate/docs/schema.dia | Bin 14438 -> 14438 bytes httemplate/docs/schema.html | 2 ++ httemplate/edit/cust_main_county.cgi | 5 ++++- httemplate/edit/process/cust_main_county.cgi | 17 +++++++++-------- 5 files changed, 25 insertions(+), 10 deletions(-) (limited to 'httemplate') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 991606087..c2473c4c8 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -21,7 +21,8 @@ print '

'. &table(). <Country State County - Taxclass + Taxclass
(per-package classification) + Tax name
(printed on invoices) Tax Exempt
per
month @@ -111,6 +112,14 @@ END } print ""; + print "{taxname} ) { + print ' BGCOLOR="#ffffff">'. $hashref->{taxname}; + } else { + print ' BGCOLOR="#cccccc">Tax'; + } + print ""; + print "$hashref->{tax}%". '$'. sprintf("%.2f", $hashref->{exempt_amount} || 0). ''. diff --git a/httemplate/docs/schema.dia b/httemplate/docs/schema.dia index c0842a602..746561550 100644 Binary files a/httemplate/docs/schema.dia and b/httemplate/docs/schema.dia differ diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html index 54adec3a7..c518d4a4d 100644 --- a/httemplate/docs/schema.html +++ b/httemplate/docs/schema.html @@ -57,6 +57,7 @@
  • recur - recurring fee
  • sdate - starting date
  • edate - ending date +
  • itemdesc - Line item description (currently used only when pkgnum is 0)
  • cust_credit - Credits. The equivalent of a negative cust_bill record.
      @@ -133,6 +134,7 @@
    • tax - % rate
    • taxclass
    • exempt_amount +
    • taxname - if defined, printed on invoices instead of "Tax"
  • cust_tax_exempt - Tax exemption record
      diff --git a/httemplate/edit/cust_main_county.cgi b/httemplate/edit/cust_main_county.cgi index 7ef37a48d..f3d28825a 100755 --- a/httemplate/edit/cust_main_county.cgi +++ b/httemplate/edit/cust_main_county.cgi @@ -15,7 +15,8 @@ print qq!
      (ALL)' , ""; + print qq!!; print qq!%!; print qq!\$$taxnum}) + my $taxnum = $1; + my $old = qsearchs('cust_main_county', { 'taxnum' => $taxnum }) or die "Couldn't find taxnum $taxnum!"; - my $exempt_amount = $cgi->param("exempt_amount$taxnum"); - next unless $old->tax ne $cgi->param("tax$taxnum") - || $old->exempt_amount ne $exempt_amount; + next unless $old->tax != $cgi->param("tax$taxnum") + || $old->exempt_amount != $cgi->param("exempt_amount$taxnum") + || $old->taxname ne $cgi->param("taxname$taxnum"); my %hash = $old->hash; $hash{tax} = $cgi->param("tax$taxnum"); - $hash{exempt_amount} = $exempt_amount; - my($new)=new FS::cust_main_county \%hash; - my($error)=$new->replace($old); + $hash{exempt_amount} = $cgi->param("exempt_amount$taxnum"); + $hash{taxname} = $cgi->param("taxname$taxnum"); + my $new = new FS::cust_main_county \%hash; + my $error = $new->replace($old); if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string ); -- cgit v1.2.1