summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2008-04-16 20:34:41 +0000
committerivan <ivan>2008-04-16 20:34:41 +0000
commitfba0d3390b1d53199777735ea0366b450aa2576b (patch)
treeb84d7706b352db49b6bb674fb47f58fa2820103d
parent6eae00a74907ad88924641a9079c59b55102fb5f (diff)
fix tax class on package def edit
-rwxr-xr-xhttemplate/edit/part_bill_event.cgi11
-rwxr-xr-xhttemplate/edit/part_pkg.cgi2
-rw-r--r--httemplate/edit/quick-charge.html4
-rw-r--r--httemplate/elements/select-taxclass.html4
-rw-r--r--httemplate/elements/tr-select-taxclass.html7
5 files changed, 14 insertions, 14 deletions
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)" %>
<SELECT NAME="payby" <% $hashref->{eventpart} ? '' : 'MULTIPLE SIZE=7'%>>
% tie my %payby, 'Tie::IxHash', FS::payby->cust_payby2longname;
% foreach my $payby ( keys %payby ) {
-%
-
-
<OPTION VALUE="<% $payby %>"<% ($part_bill_event->payby eq $payby) ? ' SELECTED' : '' %>><% $payby{$payby} %></OPTION>
% }
-
-
</SELECT> customers
</TD>
</TR>
@@ -109,11 +104,13 @@ Invoice Event #<% $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %>
%if ( $conf->exists('enable_taxclasses') ) {
% $late_taxclass =
% '<BR>Taxclass '.
-% include('/elements/select-taxclass.html', '%%%late_taxclass%%%',
+% include('/elements/select-taxclass.html',
+% 'curr_value' => '%%%late_taxclass%%%',
% 'name' => 'late_taxclass' );
% $late_percent_taxclass =
% '<BR>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 () {
<TD>
$<INPUT TYPE="text" NAME="amount" SIZE=6 VALUE="<% $amount %>" onChange="enable_quick_charge()" onKeyPress="enable_quick_charge_amount()">
</TD>
-<% 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') ) %>
</TR>
<TD>Description:</TD>
<TD>
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
% ) {
- <INPUT TYPE="hidden" NAME=""<% $opt{'element_name'} || $opt{'field'} || 'taxclass' %>" VALUE="<% $taxclass %>">
+ <INPUT TYPE="hidden" NAME=""<% $opt{'element_name'} || $opt{'field'} || 'taxclass' %>" VALUE="<% $selected_taxclass %>">
% } else {
<TR>
<TD ALIGN="right"><% $opt{'label'} || 'Tax class: ' %></TD>
<TD>
- <% include( '/elements/select-taxclass.html', $taxclass, %opt ) %>
+ <% include( '/elements/select-taxclass.html', 'curr_value' => $selected_taxclass, %opt ) %>
</TD>
</TR>
% }
<%init>
-my( $taxclass, %opt ) = @_;
+my( %opt ) = @_;
my $conf = new FS::Conf;
+my $selected_taxclass = $opt{'curr_value'}; # || $opt{'value'} necessary?
unless ( $opt{'taxclasses'} ) {