fix tax class on package def edit
authorivan <ivan>
Wed, 16 Apr 2008 20:34:41 +0000 (20:34 +0000)
committerivan <ivan>
Wed, 16 Apr 2008 20:34:41 +0000 (20:34 +0000)
httemplate/edit/part_bill_event.cgi
httemplate/edit/part_pkg.cgi
httemplate/edit/quick-charge.html
httemplate/elements/select-taxclass.html
httemplate/elements/tr-select-taxclass.html

index 322ff68..6dd92c0 100755 (executable)
@@ -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' );
 %}
 %
index 55d1d0e..39c0ac3 100755 (executable)
@@ -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',
index 95ec70c..2dcbe51 100644 (file)
@@ -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>
index 6fe35d3..2d0db30 100644 (file)
@@ -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'} ) {
index 3bba683..7006b1a 100644 (file)
@@ -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'} ) {