summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-taxoverride.html
blob: 8b1c528eb60d29b6e546ca99e26bba94aed62528 (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
      <INPUT NAME  = "<% $name %>"
             ID    = "<% $name %>"
             TYPE  = "hidden"
             VALUE = "<% $value %>"
      >
      <A href="javascript:void(0)" onclick="<% $onclick %>">
        <% $value ? "Edit $class tax overrides" : "Override $class taxes" %>
      </A>
<%init>

my %opt = @_;
my $name = $opt{element_name} || $opt{field} || 'tax_override';
my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};

my %usage_class = map { ($_->classnum => $_->classname) }
                  qsearch('usage_class', {});
$usage_class{setup} = 'Setup';
$usage_class{recur} = 'Recurring';

my $usage;
$name =~ /^tax_override_(\w+)$/ && ( $usage = $1 );

my $class = lc($usage_class{$usage} || "Usage class $usage")
  if $usage;

my $onclick = $opt{onclick} || "overlib( OLiframeContent('part_pkg_taxoverride.html?element_name=$name;selected='+document.getElementById('$name').value, 1100, 600, 'tax_product_popup'), CAPTION, 'Edit $class product tax overrides', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK); return false;";

</%init>