<%= render partial: 'shared/header', locals:{ links: [["在庫一覧", '#']]}%>
<% if false %> <% @type_id1.each do |type1| %> <%= link_to type1[0], goods_show_sum_path(type1[1], -1, -1, @start, @end, @type,@sort), class: "w8-button grey small3" if @id1 == type1[1] %> <%= link_to type1[0], goods_show_sum_path(type1[1], -1, -1, @start, @end, @type,@sort), class: "w8-button l-blue small3" if @id1 != type1[1] %> <% end %> <% end %> <% name1 = "" %> <% @type_id2.each do |type2| %> <% if @id2 == type2[1] %> <%= link_to type2[0], goods_show_sum_path(@id1, type2[1], -1, @start, @end, @type,@sort), class: "w8-button grey small3"%> <% name1 = type2[0] %> <% end %> <%= link_to type2[0], goods_show_sum_path(@id1, type2[1], -1, @start, @end, @type,@sort), class: "w8-button l-blue small3" if @id2 != type2[1] %> <% end %>


<% name2 = "" %> <% @type_id3.each do |type3| %> <% if @id3 == type3[1] %> <%= link_to type3[0], goods_show_sum_path(@id1, @id2, type3[1], @start, @end, @type,@sort), class: "w8-button grey small3" %> <% name2 = type3[0] %> <% end %> <%= link_to type3[0], goods_show_sum_path(@id1, @id2, type3[1], @start, @end, @type,@sort), class: "w8-button l-blue small3" if @id3 != type3[1] %> <% end %>







<%= form_for(@good) do |f| %> <%= hidden_field_tag :id1, @id1 %> <%= hidden_field_tag :id2, @id2 %> <%= hidden_field_tag :id3, @id3 %> <%= hidden_field_tag :type, @type %>

棚卸日

<%= date_field_tag 'end', @end %>
<%= f.submit "日付指定", class: "w8-button l-blue small" %>
<% end %>


















<%= name1 + " "+ name2 + " "+ @end.to_s %> 棚卸




<%= link_to '物品名', goods_show_sum_path(@id1, @id2, @id3, @start, @end, @type, @sort1) %>

<%= link_to '型式', goods_show_sum_path(@id1, @id2, @id3, @start, @end, @type, @sort2) %>

<% if @type == -1 || @type == 1 %>

<%= link_to '在庫数', goods_show_sum_path(@id1, @id2, @id3, @start, @end, @type, @sort3) %>

<% end %> <% if @type == -1 || @type == 2 %>

<%= link_to '単価', goods_show_sum_path(@id1, @id2, @id3, @start, @end, @type, @sort4) %>

<% end %>

合計金額

<% sum = 0 %> <% count = 0 %> <% @list.each do |list| %> <% name = list[0] %> <% memo = list[1] %> <% memo1 = list[2] %> <% push = list[3] %> <% pull = list[4] %> <% update = list[5] %> <% good = list[6] %> <% amount = list[7].to_i %> <% next if (push - pull) == 0 %> <% next if amount == 0 %>

<%= name %>

<%= memo1 %>

<%= push - pull %>

<%= amount %>

<%= amount * (push - pull) %>

<% sum += amount * (push - pull) %> <% count += 1 %> <% if count % 25 == 20 %>
<% end %> <% end %>

合計金額

<%= sum %>






<% if false %>
<%= link_to "項目追加", goods_new_path(@id), class: "w8-button l-blue small" %>
<% end %>