1 % unless ( $opt{'js_only'} ) {
3 <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
9 % $value = $item->get('quantity');
12 NAME = "<%$name%>_quantity"
13 ID = "<%$id%>_quantity"
15 VALUE = "<% scalar($cgi->param($name."_quantity"))
19 <BR><FONT SIZE="-1">Quantity</FONT>
22 % $value = $item->get('npa');
25 NAME = "<%$name%>_npa"
28 VALUE = "<% scalar($cgi->param($name."_npa"))
32 <BR><FONT SIZE="-1">NPA</FONT>
35 % $value = $item->get('ratecenternum');
37 <% include('/elements/select-table.html',
38 'name_col' => 'description',
39 'table' => 'rate_center',
42 'field' => "${name}_ratecenternum",
43 'id' => "${id}_ratecenternum",
44 'curr_value' => scalar($cgi->param("${name}_ratecenternum"))
46 'post_options' => [ 0 => 'Add new...' ],
47 onchange => 'ratecenter_changed',
50 <BR><FONT SIZE="-1">Rate Center</FONT>
51 <div style="display:none; font-size: 80%" id="<%$id%>_rc_div">
52 - add new: <INPUT TYPE = "text"
53 NAME = "<%$name%>_rc_new"
54 ID = "<%$id%>_rc_new">
58 % $value = $item->get('msanum');
60 <% include('/elements/select-table.html',
61 'name_col' => 'description',
65 'field' => "${name}_msanum",
66 'curr_value' => scalar($cgi->param("${name}_msanum"))
70 <BR><FONT SIZE="-1">MSA</FONT>
73 % $value = $item->get('latanum');
74 <TD><% include('/elements/select-table.html',
75 'name_col' => 'description',
80 'field' => "${name}_latanum",
81 'curr_value' => scalar($cgi->param("${name}_latanum"))
85 <BR><FONT SIZE="-1">LATA #</FONT>
88 % $value = $item->get('state');
89 <TD><% include('/elements/select-state.html',
93 'prefix' => "${name}_",
94 'state' => scalar($cgi->param("${name}_state"))
98 <BR><FONT SIZE="-1">State</FONT>
101 % $value = $item->get('custnum');
102 <TD><INPUT TYPE = "text"
103 NAME = "<%$name%>_custnum"
104 ID = "<%$id%>_custnum"
106 VALUE = "<% scalar($cgi->param($name."_custnum"))
110 <BR><FONT SIZE="-1">Customer #</FONT>
121 my $name = $opt{'element_name'} || $opt{'field'} || 'orderitemnum';
122 my $id = $opt{'id'} || 'orderitemnum';
124 my $curr_value = $opt{'curr_value'} || $opt{'value'};
127 if ( $opt{'onchange'} ) {
128 $onchange = $opt{'onchange'};
129 $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
130 $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
131 #callbacks should act the same
132 $onchange = 'onChange="'. $onchange. '"';
137 $item = qsearchs('did_order_item', { 'orderitemnum' => $curr_value } );
139 $item = new FS::did_order_item {};