<% allow_return_item_changes = !@return_authorization.customer_returned_items? %>
<%= f.fields_for :return_items, @form_return_items do |item_fields| %> <% return_item = item_fields.object %> <% inventory_unit = return_item.inventory_unit %> <% editable = inventory_unit.shipped? && !inventory_unit.exchange_requested? && allow_return_item_changes && return_item.reimbursement.nil? %> <% end %>
<% if allow_return_item_changes %> <%= check_box_tag 'select-all' %> <% end %> <%= Spree::Product.model_name.human %> <%= Spree::ReturnAuthorization.human_attribute_name(:state) %> <%= Spree::ReturnItem.human_attribute_name(:charged) %> <%= Spree::ReturnItem.human_attribute_name(:amount) %> <%= Spree::ReimbursementType.model_name.human %> <%= Spree::ReturnItem.human_attribute_name(:exchange_variant) %> <%= Spree::ReturnItem.human_attribute_name(:return_reason) %>
<% if editable %> <%= item_fields.hidden_field :inventory_unit_id %> <%= item_fields.check_box :_destroy, {checked: return_item.persisted?, class: 'add-item', "data-price" => return_item.amount}, '0', '1' %> <% end %>
<%= inventory_unit.variant.name %>
<%= inventory_unit.variant.options_text %>
<%= Spree.t(inventory_unit.state, scope: :inventory_states) %> <%= return_item.display_amount %> <% if editable %> <%= item_fields.text_field :amount, { class: 'refund-amount-input' } %> <% else %> <%= return_item.display_amount %> <% end %> <% if editable %> <%= item_fields.select :preferred_reimbursement_type_id, @reimbursement_types.collect{|r|[r.name.humanize, r.id]}, {include_blank: true}, {class: 'custom-select fullwidth'} %> <% else %> <%= return_item.preferred_reimbursement_type.try(:name) %> <% end %> <% if editable %> <%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants(@stock_locations), :id, :exchange_name, { include_blank: true }, { class: "custom-select fullwidth return-item-exchange-selection" } %> <% elsif return_item.exchange_processed? %> <%= return_item.exchange_variant.exchange_name %> <% end %> <% if editable %> <%= item_fields.select :return_reason_id, @reasons.collect{|r|[r.name, r.id]}, {include_blank: true}, {class: 'custom-select fullwidth'} %> <% else %> <%= return_item.return_reason.try(:name) %> <% end %>
<%= f.field_container :amount do %> <%= Spree.t(:total_pre_tax_refund) %>: 0.00 <% end %> <%= f.field_container :stock_location do %> <%= f.label :stock_location_id, Spree::StockLocation.model_name.human %> <%= f.select :stock_location_id, @stock_locations.to_a.collect{|l|[l.name, l.id]}, {include_blank: true}, {class: 'custom-select fullwidth', "data-placeholder" => Spree.t(:select_a_stock_location)} %> <%= f.error_message_on :stock_location_id %> <% end %> <%= f.field_container :memo do %> <%= f.label :memo %> <%= f.text_area :memo, {style: 'height:100px;', class: 'fullwidth'} %> <%= f.error_message_on :memo %> <% end %>