enable CardFortress in test database, #71513
[freeside.git] / httemplate / edit / did_order.html
index f20e347..6912117 100644 (file)
                             { field => 'confirmed',
                               type => 'hidden',
                             },
+                            { field => 'received',
+                              type => 'hidden',
+                            },
+                            { field => 'submitted',
+                              type => 'hidden',
+                            },
                             { field => 'stock_or_customer',
                               type => 'radio',
                               options => [ 'Stock', 'Customer', ],
@@ -44,6 +50,7 @@
               'name' => 'Bulk DID Order',
               'field_callback' => $field_callback,
               'html_bottom' => $javascript,
+              'body_etc'        => 'onLoad="stockcust_changed()"',
            )
 %>
 <%init>
@@ -65,7 +72,7 @@ my $m2_error_callback = sub {
   my($cgi, $object) = @_;
 
   #process_o2m fields in process/did_order.html
-  my @fields = qw( msa npa latanum ratecenter state quantity );
+  my @fields = qw( msanum npa latanum ratecenternum state quantity );
   my @gfields = ( '', map "_$_", @fields );
 
   map {
@@ -103,13 +110,28 @@ my $javascript = <<END;
             if ( f.stock_or_customer_Stock.checked ) {
                 custnum_search.disabled = true;
                 custnum_select.disabled = true;
+                custnum.value = '';
             }
             else if ( f.stock_or_customer_Customer.checked ) {
                 custnum_search.disabled = false;
                 custnum_select.disabled = false;
             }
-            custnum.value = '';
-            custnum_search.value = '';
+        }
+
+        /* o2m or something else is broken, can't put this in the actual
+            component because random JS and other crap is rendered 
+            onto the final output page */
+        function ratecenter_changed(rc) {
+            var idbase = rc.id.substring(0,rc.id.indexOf('_'));
+            var div = document.getElementById(idbase+'_rc_div');
+            var input = document.getElementById(idbase+'_rc_new');
+            if(rc.options[rc.selectedIndex].value == '0') {
+                div.style.display = 'inline';
+            }
+            else {
+                div.style.display = 'none';
+            }
+            input.value = '';
         }
     </SCRIPT>
 END