summaryrefslogtreecommitdiff
path: root/httemplate/edit/part_pkg_taxoverride.html
blob: 61cca1fbcdeafea69f93862b385c6f598e8f4c47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<%doc>

  The crappy version
  
</%doc>
<% include('/elements/header-popup.html', 'Select tax product') %>
<SCRIPT>
  function saveit2() {
    var num = parent.document.getElementById('tax_override');
    var sel = document.getElementById('taxoverride_popup_select');
    var value = '';
    for (i=0; i< sel.length; i++) {
      if (sel.options[i].selected) {
        value = value + sel.options[i].value + ",";
      }
    }
    if (value.length > 0) {
      value = value.substr(0, value.length-1);
    }
      
    num.value = value;
    parent.cClick();
  }
</SCRIPT>
<FORM="dummy" METHOD="POST" onsubmit="saveit2();return false;" >

<% ntable("#cccccc", 2) %>
<TR>
  <TD align="left">Tax override</TD>
  <TD>
    <% include( '/elements/select-table.html',
                'table'       => 'tax_rate',
                'name_col'    => 'taxname',
                'curr_value'  => \@curr_value,
                'element_etc' => "id='taxoverride_popup_select'",
                'multiple'    => '1',
              )
    %>
  </TD>
</TR>
</TABLE>
<BR><BR>
<CENTER><INPUT type="submit" value="Select"></CENTER>
</FORM>
<% include('/elements/footer.html') %>

<%init>

my $conf = new FS::Conf;

my @curr_value;
my ( $query ) = $cgi->keywords;
$query =~ /^([\d,]+)$/;
push @curr_value, split ',', $1
  if $1;

unless (scalar(@curr_value)) {
  #push @curr_value, map {$_=>taxnum} $part_pkg->tax_rate;
}

</%init>