<%= render partial: 'shared/header', locals: { links: [["在庫一覧", goods_show_path(@id1, @id2, @id3,1)], ["在庫情報", '#']]} %>

<%= @good.name.truncate(30) %> 入荷処理


<%= form_for(@good) do |f| %> <% if @good.errors.any? %>

<%= pluralize(@good.errors.count, "error") %> prohibited this customer from being saved:

<% end %>


<%= f.fields_for :good_histories, @new_history do |history_field| %>

更新日

<%= history_field.date_field :date %>

入荷数

<%= history_field.text_field :number_in %>

仕入価格

<%= history_field.text_field :memo2 %>

顧客名

<%= history_field.select :memo4, @customer,{include_blank: true}, class: "mySelect2", style: "width: 90%" %>

詳細

<%= history_field.text_field :memo %>
<% end %>
<%= f.submit "更新", class: "w8-button l-blue small"%>
<% end %>

現在の個数

<%= @good.number %>

最終更新日

<%= @good.last_update %>

メモ

<%= @good.memo %>


直近の履歴

<% num = 3 %> <% @histories.each do |history| %> <% next if !(history.date || history.number_in || history.number_out) %>

<%= history.date %>

IN <%= history.number_in %> / OUT <%= history.number_out %>

<%= history.memo %>

<% num -= 1 %> <% break if num == 0 %> <% end %>