From: ivan Date: Wed, 16 Apr 2008 20:34:41 +0000 (+0000) Subject: fix tax class on package def edit X-Git-Tag: root_of_webpay_support~694 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=fba0d3390b1d53199777735ea0366b450aa2576b;p=freeside.git fix tax class on package def edit --- diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 322ff688e..6dd92c0fc 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -25,13 +25,8 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> customers @@ -109,11 +104,13 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> %if ( $conf->exists('enable_taxclasses') ) { % $late_taxclass = % '
Taxclass '. -% include('/elements/select-taxclass.html', '%%%late_taxclass%%%', +% include('/elements/select-taxclass.html', +% 'curr_value' => '%%%late_taxclass%%%', % 'name' => 'late_taxclass' ); % $late_percent_taxclass = % '
Taxclass '. -% include('/elements/select-taxclass.html', '%%%late_percent_taxclass%%%', +% include('/elements/select-taxclass.html', +% 'curr_value' => '%%%late_percent_taxclass%%%', % 'name' => 'late_percent_taxclass' ); %} % diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 55d1d0ebf..39c0ac3c1 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -75,7 +75,7 @@ {type=>'justtitle', value=>'Taxation' }, {field=>'setuptax', type=>'checkbox', value=>'Y'}, {field=>'recurtax', type=>'checkbox', value=>'Y'}, - {field=>'classnum', type=>'select-taxclass' }, + {field=>'taxclass', type=>'select-taxclass' }, {field=>'taxproductnum', type=>'select-taxproduct' }, { type => 'tablebreak-tr-title', diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index 95ec70c54..2dcbe5169 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -82,8 +82,8 @@ function validate_quick_charge () { $ -<% include('/elements/tr-select-pkg_class.html', '') %> -<% include('/elements/tr-select-taxclass.html') %> +<% include('/elements/tr-select-pkg_class.html', 'curr_value' => $cgi->param('classnum') ) %> +<% include('/elements/tr-select-taxclass.html', 'curr_value' => $cgi->param('taxclass') ) %> Description: diff --git a/httemplate/elements/select-taxclass.html b/httemplate/elements/select-taxclass.html index 6fe35d32c..2d0db3068 100644 --- a/httemplate/elements/select-taxclass.html +++ b/httemplate/elements/select-taxclass.html @@ -22,7 +22,9 @@ <%init> -my( $selected_taxclass, %opt ) = @_; +my %opt = @_; +my $selected_taxclass = $opt{'curr_value'}; # || $opt{'value'} necessary? + my $conf = new FS::Conf; unless ( $opt{'taxclasses'} ) { diff --git a/httemplate/elements/tr-select-taxclass.html b/httemplate/elements/tr-select-taxclass.html index 3bba683f8..7006b1ac7 100644 --- a/httemplate/elements/tr-select-taxclass.html +++ b/httemplate/elements/tr-select-taxclass.html @@ -2,22 +2,23 @@ % || scalar(@{ $opt{'taxclasses'} }) == 0 % ) { - " VALUE="<% $taxclass %>"> + " VALUE="<% $selected_taxclass %>"> % } else { <% $opt{'label'} || 'Tax class: ' %> - <% include( '/elements/select-taxclass.html', $taxclass, %opt ) %> + <% include( '/elements/select-taxclass.html', 'curr_value' => $selected_taxclass, %opt ) %> % } <%init> -my( $taxclass, %opt ) = @_; +my( %opt ) = @_; my $conf = new FS::Conf; +my $selected_taxclass = $opt{'curr_value'}; # || $opt{'value'} necessary? unless ( $opt{'taxclasses'} ) {