X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fcust_main_county.cgi;h=232e6883ca477cdd75fbfac25fdecc467c35ac93;hb=c670aeaa5896a9d62dd1bd093b4b13dba0a52c68;hp=736d7fdbe19ad67a220b8bfb967736cc86a01e3e;hpb=9e8206dc6a253409671e6d5c904b2d5189b18a86;p=freeside.git
diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi
index 736d7fdbe..232e6883c 100755
--- a/httemplate/browse/cust_main_county.cgi
+++ b/httemplate/browse/cust_main_county.cgi
@@ -23,10 +23,6 @@
'link_onclicks' => \@link_onclicks,
)
%>
-%
-% # collapse state
-% # % }
-%
<%once>
my $conf = new FS::Conf;
@@ -102,6 +98,17 @@ sub expand_link {
'';
}
+sub collapse_link {
+ my %param = @_;
+
+ my $taxnum = $param{'row'}->taxnum;
+ my $url = "${p}edit/process/cust_main_county-collapse.cgi?$taxnum";
+ $url = "javascript:collapse_areyousure('$url')";
+
+ qq($param{'label'});
+}
+
+
sub separate_taxclasses_link {
my( $row ) = @_;
my $taxnum = $row->taxnum;
@@ -110,6 +117,8 @@ sub separate_taxclasses_link {
qq!!;
}
+#un-separate taxclasses too
+
%once>
<%init>
@@ -122,9 +131,18 @@ my $enable_taxclasses = $conf->exists('enable_taxclasses');
my @menubar;
-my $html_init =
- "Click on add states to specify a country's tax rates by state or province.
-
Click on add counties to specify a state's tax rates by county.";
+my $html_init = <
+ function collapse_areyousure(href) {
+ if (confirm("Are you sure you want to remove all county tax rates for this state?") == true)
+ window.location.href = href;
+ }
+
+
+ Click on add states to specify a country's tax rates by state or province.
+
Click on add counties to specify a state's tax rates by county, or remove counties to remove per-county tax rates.
+END
+
$html_init .= "
Click on separate taxclasses to specify taxes per taxclass."
if $enable_taxclasses;
$html_init .= '
';
@@ -360,11 +378,16 @@ my @fields = (
)
)
},
- sub { $_[0]->county || '(all) '.
- expand_link( desc => 'Add Counties',
- row => $_[0],
- label => 'add counties',
- )
+ sub { $_[0]->county
+ ? $_[0]->county. ' '.
+ collapse_link( label=> 'remove counties',
+ row => $_[0],
+ )
+ : '(all) '.
+ expand_link( desc => 'Add Counties',
+ row => $_[0],
+ label => 'add counties',
+ );
},
);