% unless ( $opt{'js_only'} ) { % my $value = ''; % $value = $item->get('quantity'); % $value = $item->get('npa'); % $value = $item->get('ratecenternum'); % $value = $item->get('msanum'); % $value = $item->get('latanum'); % $value = $item->get('state'); % $value = $item->get('custnum');
" <% $onchange %> >
Quantity
" <% $onchange %> >
NPA
<% include('/elements/select-table.html', 'name_col' => 'description', 'table' => 'rate_center', 'disable_empty' => 0, 'empty_label' => ' ', 'field' => "${name}_ratecenternum", 'id' => "${id}_ratecenternum", 'curr_value' => scalar($cgi->param("${name}_ratecenternum")) || $value, 'post_options' => [ 0 => 'Add new...' ], onchange => 'ratecenter_changed', ) %>
Rate Center
<% include('/elements/select-table.html', 'name_col' => 'description', 'table' => 'msa', 'disable_empty' => 0, 'empty_label' => ' ', 'field' => "${name}_msanum", 'curr_value' => scalar($cgi->param("${name}_msanum")) || $value, ) %>
MSA
<% include('/elements/select-table.html', 'name_col' => 'description', 'table' => 'lata', 'disable_empty' => 0, 'empty_label' => ' ', 'label_showkey' => 1, 'field' => "${name}_latanum", 'curr_value' => scalar($cgi->param("${name}_latanum")) || $value, ) %>
LATA #
<% include('/elements/select-state.html', 'disable_empty' => 0, 'empty_label' => ' ', 'country' => 'US', 'prefix' => "${name}_", 'state' => scalar($cgi->param("${name}_state")) || $value, ) %>
State
" <% $onchange %> >
Customer #
% } <%init> my( %opt ) = @_; my $name = $opt{'element_name'} || $opt{'field'} || 'orderitemnum'; my $id = $opt{'id'} || 'orderitemnum'; my $curr_value = $opt{'curr_value'} || $opt{'value'}; my $onchange = ''; if ( $opt{'onchange'} ) { $onchange = $opt{'onchange'}; $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/; $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange #callbacks should act the same $onchange = 'onChange="'. $onchange. '"'; } my $item; if ( $curr_value ) { $item = qsearchs('did_order_item', { 'orderitemnum' => $curr_value } ); } else { $item = new FS::did_order_item {}; }