X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fdid_order_item.html;h=00668f94f1abdd188472f96bacbaf30b49942655;hb=849a709d89e78bec1ab19997b75de1b574969f1f;hp=263826ecc462bd75fdef8be02dc309ffa0c95d46;hpb=31f2e890b5b3e1b0ad29a877ff67bc641ea1fc40;p=freeside.git diff --git a/httemplate/elements/did_order_item.html b/httemplate/elements/did_order_item.html index 263826ecc..00668f94f 100644 --- a/httemplate/elements/did_order_item.html +++ b/httemplate/elements/did_order_item.html @@ -4,23 +4,98 @@ -% foreach my $field ( @fields ) { -% -% my $value = ''; -% $value = $item->get($field); +% my $value = ''; - -% } + > +
Quantity + + +% $value = $item->get('npa'); + + +% $value = $item->get('ratecenternum'); + + +% $value = $item->get('msanum'); + + +% $value = $item->get('latanum'); + + +% $value = $item->get('state'); + +
+% $value = $item->get('quantity'); + " - <% $onchange %> - >
- <% $label{$field} %> -
+ " + > +
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 +
@@ -34,15 +109,6 @@ 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 } ); @@ -50,20 +116,4 @@ if ( $curr_value ) { $item = new FS::did_order_item {}; } -my %size = ( 'npa' => 3, - 'latanum' => 3, - 'state' => 2, - 'quantity' => 3,); - -tie my %label, 'Tie::IxHash', - 'msa' => 'MSA', - 'npa' => 'NPA', - 'latanum' => 'LATA #', - 'rate_center' => 'Rate Center', - 'state' => 'State', - 'quantity' => 'Quantity', -; - -my @fields = keys %label; -