
<table class="table table-striped">
  <tr>
    <th>#</th>
    <th><%= t("views.right_panel.detail.product") %></th>
    <th><%= t("views.right_panel.detail.min_order") %></th>
    <th><%= t("views.right_panel.detail.max_stock") %></th>
    <th><%= t("views.right_panel.detail.created_by") %></th>
    <th><%= t("views.right_panel.detail.created_time") %></th>
  </tr>
  <%
  count = 0
  @products.each do |item|
    count += 1
    %>
    <tr>
      <td><%= count %></td>
      <td>
        <% menu_item = MenuItemInstance.find_by_item_instance_code(item.item_code)%>
        <% if menu_item.nil? %>
        <%= Product.find_by_item_code(item.item_code).name rescue "-" %>
        <% else %>
        <%= menu_item.menu_item.name rescue "-" %>
        - <%= menu_item.item_instance_name rescue "-" %>
        <% end %>
      </td>
      <td><%= item.min_order_level %></td>
      <td><%= item.max_stock_level %></td>
      <td><%= Employee.find(item.created_by).name rescue '-' %></td>
      <td><%= item.created_at.utc.getlocal.strftime("%e %b %Y %I:%M %p") rescue '-' %></td>
    </tr>
    <% end %>
  </table>

