<% content_for :page_title do %> <%= plural_resource_name(Spree::StockTransfer) %> <% end %> <% content_for :page_actions do %> <%= button_link_to Spree.t(:new_stock_transfer), new_admin_stock_transfer_path, { :icon => 'add', :class => 'btn-success' } %> <% end if can? :create, Spree::StockTransfer %>
<%= Spree.t(:search) %> <%= search_form_for @q, :url => admin_stock_transfers_path do |f| %>
<%= f.label :reference_cont, Spree.t(:reference_contains) %> <%= f.text_field :reference_cont, class: 'form-control' %>
<%= f.label :source_location, Spree.t(:source) %> <%= f.select :source_location_id_eq, options_from_collection_for_select(@stock_locations, :id, :name, @q.source_location_id_eq), { include_blank: true }, class: 'select2' %>
<%= f.label :destination_location, Spree.t(:destination) %> <%= f.select :destination_location_id_eq, options_from_collection_for_select(@stock_locations, :id, :name, @q.destination_location_id_eq), { include_blank: true }, class: 'select2' %>
<%= button Spree.t(:filter_results), 'search' %>
<% end %>
<% if @stock_transfers.any? %> <% @stock_transfers.each do |stock_transfer| %> <% end %>
<%= Spree.t(:created_at) %> <%= Spree.t(:reference) %> <%= Spree.t(:source) %> <%= Spree.t(:destination) %>
<%= link_to stock_transfer.created_at, admin_stock_transfer_path(stock_transfer) %> <%= stock_transfer.reference %> <%= stock_transfer.source_location.try(:name) %> <%= stock_transfer.destination_location.try(:name) %> <%= link_to_with_icon 'show', Spree.t(:show), admin_stock_transfer_path(stock_transfer), :class => 'btn btn-default btn-sm', :no_text => true, :data => {:action => 'view'} %>
<% else %>
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::StockTransfer)) %>, <%= link_to(Spree.t(:add_one), new_admin_stock_transfer_path) if can? :create, Spree::StockTransfer %>!
<% end %> <%= paginate @stock_transfers %>