From 51984ac3d3da3006809c6866fdecd4ad83610731 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jul 2001 07:36:04 +0000 Subject: templates!!! --- httemplate/browse/cust_main_county.cgi | 108 +++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 httemplate/browse/cust_main_county.cgi (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi new file mode 100755 index 0000000..9654150 --- /dev/null +++ b/httemplate/browse/cust_main_county.cgi @@ -0,0 +1,108 @@ +<% +# +# $Id: cust_main_county.cgi,v 1.1 2001-07-30 07:36:03 ivan Exp $ +# +# ivan@sisd.com 97-dec-13 +# +# Changes to allow page to work at a relative position in server +# bmccane@maxbaud.net 98-apr-3 +# +# lose background, FS::CGI ivan@sisd.com 98-sep-2 +# +# $Log: cust_main_county.cgi,v $ +# Revision 1.1 2001-07-30 07:36:03 ivan +# templates!!! +# +# Revision 1.7 1999/04/09 04:22:34 ivan +# also table() +# +# Revision 1.6 1999/04/09 03:52:55 ivan +# explicit & for table/itable/ntable +# +# Revision 1.5 1999/01/19 05:13:26 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.4 1999/01/18 09:41:16 ivan +# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl +# (good idea anyway) +# +# Revision 1.3 1998/12/17 05:25:18 ivan +# fix visual and other bugs +# +# Revision 1.2 1998/11/18 09:01:34 ivan +# i18n! i18n! +# + +use strict; +use vars qw( $cgi $p $cust_main_county ); +use CGI; +use CGI::Carp qw(fatalsToBrowser); +use FS::UID qw(cgisuidsetup swapuid); +use FS::Record qw(qsearch qsearchs); +use FS::CGI qw(header menubar popurl table); +use FS::cust_main_county; + +$cgi = new CGI; + +&cgisuidsetup($cgi); + +$p = popurl(2); + +print $cgi->header( '-expires' => 'now' ), header("Tax Rate Listing", menubar( + 'Main Menu' => $p, + 'Edit tax rates' => $p. "edit/cust_main_county.cgi", +)),<expand country to specify a country's tax rates by state. +
Click on expand state to specify a state's tax rates by county. +

+END +print &table(), < + Country + State + County + Tax + +END + +foreach $cust_main_county ( qsearch('cust_main_county',{}) ) { + my($hashref)=$cust_main_county->hashref; + print < + $hashref->{country} +END + print "", $hashref->{state} + ? $hashref->{state} + : qq!(ALL) !. + qq!expand country! + , ""; + print ""; + if ( $hashref->{county} ) { + print $hashref->{county}; + } else { + print "(ALL)"; + if ( $hashref->{state} ) { + print qq!!. + qq!expand state!; + } + } + print ""; + + print <$hashref->{tax}% + +END + +} + +print < + + + +END + +%> -- cgit v1.1 From 94d7e3f0d3431fc1a16afea163367a79ccc78d95 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 17 Aug 2001 11:05:31 +0000 Subject: clean up tax rate editing: sort by country->state->county, add "collapse state" if the tax rates are the same statewide, redirect "expand state" to the browse, not edit screen --- httemplate/browse/cust_main_county.cgi | 94 +++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 42 deletions(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 9654150..9cce67d 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -1,38 +1,5 @@ <% -# -# $Id: cust_main_county.cgi,v 1.1 2001-07-30 07:36:03 ivan Exp $ -# -# ivan@sisd.com 97-dec-13 -# -# Changes to allow page to work at a relative position in server -# bmccane@maxbaud.net 98-apr-3 -# -# lose background, FS::CGI ivan@sisd.com 98-sep-2 -# -# $Log: cust_main_county.cgi,v $ -# Revision 1.1 2001-07-30 07:36:03 ivan -# templates!!! -# -# Revision 1.7 1999/04/09 04:22:34 ivan -# also table() -# -# Revision 1.6 1999/04/09 03:52:55 ivan -# explicit & for table/itable/ntable -# -# Revision 1.5 1999/01/19 05:13:26 ivan -# for mod_perl: no more top-level my() variables; use vars instead -# also the last s/create/new/; -# -# Revision 1.4 1999/01/18 09:41:16 ivan -# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl -# (good idea anyway) -# -# Revision 1.3 1998/12/17 05:25:18 ivan -# fix visual and other bugs -# -# Revision 1.2 1998/11/18 09:01:34 ivan -# i18n! i18n! -# +# use strict; use vars qw( $cgi $p $cust_main_county ); @@ -66,18 +33,61 @@ print &table(), < END -foreach $cust_main_county ( qsearch('cust_main_county',{}) ) { - my($hashref)=$cust_main_county->hashref; +my @regions = sort { $a->country cmp $b->country + or $a->state cmp $b->state + or $a->county cmp $b->county + } qsearch('cust_main_county',{}); + +my $sup=0; +#foreach $cust_main_county ( @regions ) { +for ( my $i=0; $i<@regions; $i++ ) { + my $cust_main_county = $regions[$i]; + my $hashref = $cust_main_county->hashref; print < $hashref->{country} END - print "", $hashref->{state} - ? $hashref->{state} - : qq!(ALL) !. - qq!expand country! - , ""; + + my $j; + if ( $sup ) { + $sup--; + } else { + + #lookahead + for ( $j=1; $i+$j<@regions; $j++ ) { + last if $hashref->{country} ne $regions[$i+$j]->country + || $hashref->{state} ne $regions[$i+$j]->state + || $hashref->{tax} != $regions[$i+$j]->tax; + } + + my $newsup=0; + if ( $j>1 && $i+$j+1 < @regions + && ( $hashref->{state} ne $regions[$i+$j+1]->state + || $hashref->{country} ne $regions[$i+$j+1]->country + ) + && ( ! $i + || $hashref->{state} ne $regions[$i-1]->state + || $hashref->{country} ne $regions[$i-1]->country + ) + ) { + $sup = $j-1; + } else { + $j = 1; + } + + print "", $hashref->{state} + ? $hashref->{state} + : qq!(ALL) !. + qq!expand country!; + + print qq! collapse state! if $j>1; + + print ""; + } + +# $sup=$newsup; + print ""; if ( $hashref->{county} ) { print $hashref->{county}; -- cgit v1.1 From 6ef34dda51afba96d8dc6c4dd72427c3d4003945 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 21 Aug 2001 09:34:13 +0000 Subject: no more &swapuid --- httemplate/browse/cust_main_county.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 9cce67d..f7c749c 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -1,11 +1,11 @@ <% -# +# use strict; use vars qw( $cgi $p $cust_main_county ); use CGI; use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup swapuid); +use FS::UID qw(cgisuidsetup); use FS::Record qw(qsearch qsearchs); use FS::CGI qw(header menubar popurl table); use FS::cust_main_county; -- cgit v1.1 From 91387f8f489e561deaf1de052d80ef800a4970a3 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 26 Oct 2001 10:24:56 +0000 Subject: cache foo *sigh* --- httemplate/browse/cust_main_county.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index f7c749c..7db581f 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $p $cust_main_county ); @@ -16,7 +16,7 @@ $cgi = new CGI; $p = popurl(2); -print $cgi->header( '-expires' => 'now' ), header("Tax Rate Listing", menubar( +print $cgi->header( @FS::CGI::header ), header("Tax Rate Listing", menubar( 'Main Menu' => $p, 'Edit tax rates' => $p. "edit/cust_main_county.cgi", )),< Date: Tue, 30 Oct 2001 14:54:07 +0000 Subject: get rid of header foo in individual templates --- httemplate/browse/cust_main_county.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 7db581f..bbd75cc 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; use vars qw( $cgi $p $cust_main_county ); @@ -16,7 +16,7 @@ $cgi = new CGI; $p = popurl(2); -print $cgi->header( @FS::CGI::header ), header("Tax Rate Listing", menubar( +print header("Tax Rate Listing", menubar( 'Main Menu' => $p, 'Edit tax rates' => $p. "edit/cust_main_county.cgi", )),< Date: Wed, 30 Jan 2002 14:18:09 +0000 Subject: remove use Module; and $cgi = new CGI; &cgisuidsetup(); from all templates. should work better under Mason. --- httemplate/browse/cust_main_county.cgi | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index bbd75cc..89b1bfd 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -1,20 +1,5 @@ + <% -# - -use strict; -use vars qw( $cgi $p $cust_main_county ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header menubar popurl table); -use FS::cust_main_county; - -$cgi = new CGI; - -&cgisuidsetup($cgi); - -$p = popurl(2); print header("Tax Rate Listing", menubar( 'Main Menu' => $p, -- cgit v1.1 From 22a35047ecdffff80110e06cc08fc84f9ddba9b0 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 13:21:31 +0000 Subject: removed from all files to fix any redirects, whew Mason handler.pl overrides CGI::redirect fixed strict; problems in edit/part_pkg.cgi & edit/process/part_pkg.cgi --- httemplate/browse/cust_main_county.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 89b1bfd..7273dd0 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -1,4 +1,3 @@ - <% print header("Tax Rate Listing", menubar( -- cgit v1.1 From a4c96748eb6eab29a70f3a944c6520283a635c78 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 16:05:22 +0000 Subject: *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. --- httemplate/browse/cust_main_county.cgi | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 7273dd0..8fbd7fa 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -1,3 +1,4 @@ + <% print header("Tax Rate Listing", menubar( -- cgit v1.1 From 87af741da0dd5f6a76bbb566b4d6c54cd5b15315 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 5 Apr 2002 23:51:18 +0000 Subject: - add message catalog table & beginning of web interface - add security_phrase and conf option to svc_acct.pm - random other stuff --- httemplate/browse/cust_main_county.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 8fbd7fa..5df8dfa 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -95,7 +95,6 @@ END print < - END -- cgit v1.1 From a63b2729682586d8860290576e9307629424dbe0 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 9 May 2002 12:38:40 +0000 Subject: texas tax! --- httemplate/browse/cust_main_county.cgi | 59 ++++++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 17 deletions(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 5df8dfa..9916060 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -1,26 +1,36 @@ <% +my $conf = new FS::Conf; +my $enable_taxclasses = $conf->exists('enable_taxclasses'); + print header("Tax Rate Listing", menubar( 'Main Menu' => $p, 'Edit tax rates' => $p. "edit/cust_main_county.cgi", )),<expand country to specify a country's tax rates by state.
Click on expand state to specify a state's tax rates by county. -

END -print &table(), <Click on expand taxclasses to specify tax classes'; +} + +print '

'. &table(). < Country State County + Taxclass Tax + Exempt
per
month END -my @regions = sort { $a->country cmp $b->country - or $a->state cmp $b->state - or $a->county cmp $b->county +my @regions = sort { $a->country cmp $b->country + or $a->state cmp $b->state + or $a->county cmp $b->county + or $a->taxclass cmp $b->taxclass } qsearch('cust_main_county',{}); my $sup=0; @@ -30,7 +40,7 @@ for ( my $i=0; $i<@regions; $i++ ) { my $hashref = $cust_main_county->hashref; print < - $hashref->{country} + $hashref->{country} END my $j; @@ -42,7 +52,8 @@ END for ( $j=1; $i+$j<@regions; $j++ ) { last if $hashref->{country} ne $regions[$i+$j]->country || $hashref->{state} ne $regions[$i+$j]->state - || $hashref->{tax} != $regions[$i+$j]->tax; + || $hashref->{tax} != $regions[$i+$j]->tax + || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount; } my $newsup=0; @@ -60,9 +71,9 @@ END $j = 1; } - print "", $hashref->{state} - ? $hashref->{state} - : qq!(ALL) !. + print "{state} + ? ' BGCOLOR="#ffffff">'. $hashref->{state} + : qq! BGCOLOR="#cccccc">(ALL) !. qq!expand country!; @@ -73,11 +84,11 @@ END # $sup=$newsup; - print ""; + print "{county} ) { - print $hashref->{county}; + print ' BGCOLOR="#ffffff">'. $hashref->{county}; } else { - print "(ALL)"; + print ' BGCOLOR="#cccccc">(ALL)'; if ( $hashref->{state} ) { print qq!!. qq!"; - print <$hashref->{tax}% - -END + print "{taxclass} ) { + print ' BGCOLOR="#ffffff">'. $hashref->{taxclass}; + } else { + print ' BGCOLOR="#cccccc">(ALL)'; + if ( $enable_taxclasses ) { + print qq!!. + qq!expand taxclasses!; + } + + } + print ""; + + print "$hashref->{tax}%". + '$'. + sprintf("%.2f", $hashref->{exempt_amount} || 0). ''. + ''; } -- cgit v1.1 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 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 9916060..c2473c4 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). ''. -- cgit v1.1 From 4f253eb015531465e049c858a7520e8c7a71d227 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 25 Sep 2003 11:49:44 +0000 Subject: UI for multiple named taxes w/setup & recur exemptions 1.4 schema-auto-adjusting backport --- httemplate/browse/cust_main_county.cgi | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index c2473c4..e582721 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -24,7 +24,7 @@ print '

'. &table(). <Taxclass
(per-package classification) Tax name
(printed on invoices) Tax - Exempt
per
month + Exemption END @@ -54,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; @@ -121,9 +123,13 @@ END print ""; print "$hashref->{tax}%". - '$'. - sprintf("%.2f", $hashref->{exempt_amount} || 0). ''. - ''; + ''; + print '$'. sprintf("%.2f", $hashref->{exempt_amount} ). + ' per month
' + if $hashref->{exempt_amount}; + print 'Setup fee
' if $hashref->{setuptax} =~ /^Y$/i; + print 'Recurring fee
' if $hashref->{recurtax} =~ /^Y$/i; + print ''; } -- cgit v1.1 From bfe2b53779bd76e03aa8deaca07ba916da6b3f5b Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 26 Sep 2003 08:11:12 +0000 Subject: fix tax edit UI --- httemplate/browse/cust_main_county.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/browse/cust_main_county.cgi') diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index e582721..1e0e088 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -126,7 +126,7 @@ END ''; print '$'. sprintf("%.2f", $hashref->{exempt_amount} ). ' per month
' - if $hashref->{exempt_amount}; + if $hashref->{exempt_amount} > 0; print 'Setup fee
' if $hashref->{setuptax} =~ /^Y$/i; print 'Recurring fee
' if $hashref->{recurtax} =~ /^Y$/i; print ''; -- cgit v1.1