From 37f181cc0b65e4509dd68593cb7555db42d8e088 Mon Sep 17 00:00:00 2001 From: jeff Date: Wed, 2 Apr 2008 20:42:44 +0000 Subject: checkpoint tax editors and correct a blunder --- httemplate/edit/part_pkg.cgi | 7 +- httemplate/edit/part_pkg_taxoverride.html | 157 +++++++++++++++++++++--------- httemplate/edit/process/part_pkg.cgi | 2 +- 3 files changed, 115 insertions(+), 51 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 84f7498e1..2e7c732e6 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -94,13 +94,13 @@ Tax information Tax product - + - + <% $tax_override ? 'Edit tax overrides' : 'Override taxes' %> @@ -467,7 +467,8 @@ if ( $cgi->param('clone') ) { (@agent_type) = map {$_->typenum} qsearch('type_pkgs',{'pkgpart'=>$1}) unless $part_pkg; $tax_override = - join (",", map {$_->taxnum} qsearch('part_pkg_taxoverride',{'pkgpart'=>$1})) + join (",", map {$_->taxclassnum} + qsearch('part_pkg_taxoverride',{'pkgpart'=>$1})) unless $part_pkg; $part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1}); $pkgpart = $part_pkg->pkgpart; diff --git a/httemplate/edit/part_pkg_taxoverride.html b/httemplate/edit/part_pkg_taxoverride.html index 61cca1fbc..ba709ce64 100644 --- a/httemplate/edit/part_pkg_taxoverride.html +++ b/httemplate/edit/part_pkg_taxoverride.html @@ -1,61 +1,124 @@ -<%doc> +<% include('/elements/header-popup.html', 'Override taxes', '', 'onload="resizeFrames()"') %> - The crappy version - - -<% include('/elements/header-popup.html', 'Select tax product') %> + + + + + + + +
+ +
+
+ +
+ + +
+ +
+ +
+
- - -<% ntable("#cccccc", 2) %> - - Tax override - - <% include( '/elements/select-table.html', - 'table' => 'tax_rate', - 'name_col' => 'taxname', - 'curr_value' => \@curr_value, - 'element_etc' => "id='taxoverride_popup_select'", - 'multiple' => '1', - ) - %> - - - -

-
- + <% include('/elements/footer.html') %> +<%once> + +my $conf = new FS::Conf; + <%init> -my $conf = new FS::Conf; +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + + +my $selected_offset = $1 + if $cgi->param('selected_offset') =~/^(\d+)$/; -my @curr_value; -my ( $query ) = $cgi->keywords; -$query =~ /^([\d,]+)$/; -push @curr_value, split ',', $1 - if $1; +my $unselected_offset = $1 + if $cgi->param('unselected_offset') =~/^(\d+)$/; -unless (scalar(@curr_value)) { - #push @curr_value, map {$_=>taxnum} $part_pkg->tax_rate; -} +my $selected = $1 + if $cgi->param('selected') =~/^([,\d]+)$/; diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index eac20af57..94bff0fbb 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -116,7 +116,7 @@ unless ( $error || $conf->exists('agent_defaultpkg') ) { unless ( $error ) { $error = $new->process_m2m( 'link_table' => 'part_pkg_taxoverride', - 'target_table' => 'tax_rate', + 'target_table' => 'tax_class', 'params' => \@tax_overrides, ); } -- cgit v1.2.1