checkpoint of new tax rating system
[freeside.git] / httemplate / edit / part_pkg_taxoverride.html
1 <%doc>
2
3   The crappy version
4   
5 </%doc>
6 <% include('/elements/header-popup.html', 'Select tax product') %>
7 <SCRIPT>
8   function saveit2() {
9     var num = parent.document.getElementById('tax_override');
10     var sel = document.getElementById('taxoverride_popup_select');
11     var value = '';
12     for (i=0; i< sel.length; i++) {
13       if (sel.options[i].selected) {
14         value = value + sel.options[i].value + ",";
15       }
16     }
17     if (value.length > 0) {
18       value = value.substr(0, value.length-1);
19     }
20       
21     num.value = value;
22     parent.cClick();
23   }
24 </SCRIPT>
25 <FORM="dummy" METHOD="POST" onsubmit="saveit2();return false;" >
26
27 <% ntable("#cccccc", 2) %>
28 <TR>
29   <TD align="left">Tax override</TD>
30   <TD>
31     <% include( '/elements/select-table.html',
32                 'table'       => 'tax_rate',
33                 'name_col'    => 'taxname',
34                 'curr_value'  => \@curr_value,
35                 'element_etc' => "id='taxoverride_popup_select'",
36                 'multiple'    => '1',
37               )
38     %>
39   </TD>
40 </TR>
41 </TABLE>
42 <BR><BR>
43 <CENTER><INPUT type="submit" value="Select"></CENTER>
44 </FORM>
45 <% include('/elements/footer.html') %>
46
47 <%init>
48
49 my $conf = new FS::Conf;
50
51 my @curr_value;
52 my ( $query ) = $cgi->keywords;
53 $query =~ /^([\d,]+)$/;
54 push @curr_value, split ',', $1
55   if $1;
56
57 unless (scalar(@curr_value)) {
58   #push @curr_value, map {$_=>taxnum} $part_pkg->tax_rate;
59 }
60
61 </%init>