
<div class="page-header">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="<%= dashboard_path %>">Home</a></li>
     <% if @table %>
           <li  class="breadcrumb-item"><a href="<%= edit_settings_zone_table_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
        <% elsif @room %>
           <li  class="breadcrumb-item"><a href="<%= edit_settings_zone_room_path(@zone,@settings_dining_facility) %>">Table / Room</a></li>
        <% end %>
    <li class="breadcrumb-item active">New</li>
    <span class="float-right">
      <%= link_to t('.back', :default => t("views.btn.back")), settings_zone_path(@zone) %>
    </span>
  </ol>
</div>

<%= render 'form', dining_charge: @dining_charge %>
<script>
  function randomNumber(len) {
    var randomNumber;
    var n = '';

    for(var count = 0; count < len; count++) {
        randomNumber = Math.floor(Math.random() * 10);
        n += randomNumber.toString();
    }
    return n;
}
document.getElementById("item_code").value = "<%= @zone.id %>"+"<%= @settings_dining_facility.id %>"+"_"+randomNumber(5); 
</script>