This commit was generated by cvs2svn to compensate for changes in r11022,
[freeside.git] / httemplate / elements / did_order_item.html
1 % unless ( $opt{'js_only'} ) {
2
3   <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
4
5   <TABLE>
6     <TR>
7 %     my $value = '';
8
9 %     $value = $item->get('quantity');
10       <TD>
11           <INPUT TYPE  = "text"
12                  NAME  = "<%$name%>_quantity"
13                  ID    = "<%$id%>_quantity"
14                  SIZE  = "3"
15                  VALUE = "<% scalar($cgi->param($name."_quantity"))
16                              || $value |h %>"
17           >
18           <BR><FONT SIZE="-1">Quantity</FONT>
19       </TD>
20       
21 %     $value = $item->get('npa');
22       <TD>
23           <INPUT TYPE  = "text"
24                  NAME  = "<%$name%>_npa"
25                  ID    = "<%$id%>_npa"
26                  SIZE  = "3"
27                  VALUE = "<% scalar($cgi->param($name."_npa"))
28                              || $value |h %>"
29           >
30           <BR><FONT SIZE="-1">NPA</FONT>
31       </TD>
32
33 %     $value = $item->get('ratecenternum');
34       <TD>
35         <% include('/elements/select-table.html',
36                          'name_col'      => 'description',
37                          'table'         => 'rate_center',
38                          'disable_empty' => 0,
39                          'empty_label'   => ' ',
40                          'field'         => "${name}_ratecenternum",
41                          'id'            => "${id}_ratecenternum",
42                          'curr_value'    => scalar($cgi->param("${name}_ratecenternum"))
43                                              || $value,
44                          'post_options'  => [ 0 => 'Add new...' ],
45                          onchange        => 'ratecenter_changed',
46                   )
47          %>
48         <BR><FONT SIZE="-1">Rate Center</FONT>
49         <div style="display:none; font-size: 80%" id="<%$id%>_rc_div">
50              - add new: <INPUT TYPE  = "text"
51                  NAME  = "<%$name%>_rc_new"
52                  ID    = "<%$id%>_rc_new">
53         </div>
54       </TD>
55
56 %     $value = $item->get('msanum');
57       <TD>
58         <% include('/elements/select-table.html',
59                          'name_col'      => 'description',
60                          'table'         => 'msa',
61                          'disable_empty' => 0,
62                          'empty_label'   => ' ',
63                          'field'         => "${name}_msanum",
64                          'curr_value'    => scalar($cgi->param("${name}_msanum"))
65                                              || $value,
66                    )
67          %>
68         <BR><FONT SIZE="-1">MSA</FONT>
69       </TD>
70
71 %     $value = $item->get('latanum');
72       <TD><% include('/elements/select-table.html',
73                          'name_col'      => 'description',
74                          'table'         => 'lata',
75                          'disable_empty' => 0,
76                          'empty_label'   => ' ',
77                          'label_showkey' => 1,
78                          'field'         => "${name}_latanum",
79                          'curr_value'    => scalar($cgi->param("${name}_latanum"))
80                                              || $value,
81                      )
82             %>
83         <BR><FONT SIZE="-1">LATA #</FONT>
84       </TD>
85
86 %     $value = $item->get('state');
87       <TD><% include('/elements/select-state.html',
88                          'disable_empty' => 0,
89                          'empty_label'   => ' ',
90                          'country'       => 'US',
91                          'prefix'        => "${name}_",
92                          'state'         => scalar($cgi->param("${name}_state"))
93                                             || $value,
94                      )
95             %>
96           <BR><FONT SIZE="-1">State</FONT>
97       </TD>
98
99     </TR>
100   </TABLE>
101
102 % }
103 <%init>
104
105 my( %opt ) = @_;
106
107 my $name = $opt{'element_name'} || $opt{'field'} || 'orderitemnum';
108 my $id = $opt{'id'} || 'orderitemnum';
109
110 my $curr_value = $opt{'curr_value'} || $opt{'value'};
111
112 my $item;
113 if ( $curr_value ) {
114   $item = qsearchs('did_order_item', { 'orderitemnum' => $curr_value } );
115 } else {
116   $item = new FS::did_order_item {};
117 }
118
119 </%init>