v4 style
[freeside.git] / httemplate / elements / did_order_item.html
index 00668f9..d1f90f3 100644 (file)
@@ -14,6 +14,7 @@
                  SIZE  = "3"
                  VALUE = "<% scalar($cgi->param($name."_quantity"))
                              || $value |h %>"
+                 <% $onchange %>
           >
           <BR><FONT SIZE="-1">Quantity</FONT>
       </TD>
@@ -26,6 +27,7 @@
                  SIZE  = "3"
                  VALUE = "<% scalar($cgi->param($name."_npa"))
                              || $value |h %>"
+                 <% $onchange %>
           >
           <BR><FONT SIZE="-1">NPA</FONT>
       </TD>
           <BR><FONT SIZE="-1">State</FONT>
       </TD>
 
+%     $value = $item->get('custnum');
+      <TD><INPUT TYPE  = "text"
+                 NAME  = "<%$name%>_custnum"
+                 ID    = "<%$id%>_custnum"
+                 SIZE  = "7"
+                 VALUE = "<% scalar($cgi->param($name."_custnum"))
+                             || $value |h %>"
+                 <% $onchange %>
+          >
+          <BR><FONT SIZE="-1">Customer #</FONT>
+      </TD>
+
     </TR>
   </TABLE>
 
@@ -109,6 +123,15 @@ 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 } );