update inventory form and list

This commit is contained in:
Aung Myo
2018-09-20 16:52:15 +06:30
parent ee56ccea21
commit 5a155f596d
8 changed files with 131 additions and 57 deletions

View File

@@ -44,28 +44,28 @@
<table class="table table-striped col-md-12">
<tr>
<th>#</th>
<th><%= t("views.right_panel.header.menu_category") %></th>
<th><%= t("views.right_panel.detail.product") %></th>
<th><%= t("views.right_panel.detail.stock_count") %></th>
<th><%= t("views.right_panel.detail.stock_balance") %></th>
<th><%= t("views.right_panel.detail.different") %></th>
<th><%= t("views.right_panel.detail.remark") %></th>
</tr>
<% cate_arr = Array.new %>
<%
count = 0
@check.stock_check_items.each do |item|
@stock_check_items.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>
<% if !cate_arr.include?(item.menu_category_id) %>
<td><%= item.menu_category_name %></td>
<% cate_arr.push(item.menu_category_id) %>
<% else %>
<td>&nbsp;</td>
<% end %>
<td><%= item.item_name rescue '-' %> - <%= item.instance_name%></td>
<td><%= item.stock_count %></td>
<td><%= item.stock_balance %></td>
<td><%= item.different %></td>