<% 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? && allow_return_item_changes && return_item.reimbursement.nil? %> <% end %>
<% if allow_return_item_changes %> <%= check_box_tag 'select-all' %> <% end %> <%= Spree.t(:product) %> <%= Spree.t(:state) %> <%= Spree.t(:charged) %> <%= Spree.t(:pre_tax_refund_amount) %> <%= Spree.t(:reimbursement_type) %> <%= Spree.t(:exchange_for) %>
<% 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.pre_tax_amount}, '0', '1' %> <% end %>
<%= inventory_unit.variant.name %>
<%= inventory_unit.variant.options_text %>
<%= inventory_unit.state.humanize %> <%= return_item.display_pre_tax_amount %> <% if editable %> <%= item_fields.text_field :pre_tax_amount, { class: 'refund-amount-input form-control' } %> <% else %> <%= return_item.display_pre_tax_amount %> <% end %> <% if editable %> <%= item_fields.select :preferred_reimbursement_type_id, @reimbursement_types.collect{|r|[r.name.humanize, r.id]}, {include_blank: true}, {class: 'select2'} %> <% end %> <% if editable %> <% if return_item.exchange_processed? %> <%= return_item.exchange_variant.options_text %> <% else %> <%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :options_text, { include_blank: true }, { class: "select2 return-item-exchange-selection" } %> <% end %> <% end %>
<%= f.field_container :amount, class: ['alert alert-info'] do %> <%= Spree.t(:total_pre_tax_refund) %>: 0.00 <% end %> <%= f.field_container :stock_location, class: ['form-group'] do %> <%= f.label :stock_location, Spree.t(:stock_location) %> <%= f.select :stock_location_id, Spree::StockLocation.order_default.active.to_a.collect{|l|[l.name, l.id]}, {include_blank: true}, {class: 'select2', "data-placeholder" => Spree.t(:select_a_stock_location)} %> <%= f.error_message_on :stock_location_id %> <% end %> <%= f.field_container :reason, class: ['form-group'] do %> <%= f.label :reason, Spree.t(:reason) %> <%= f.select :return_authorization_reason_id, @reasons.collect{|r|[r.name, r.id]}, {include_blank: true}, {class: 'select2', "data-placeholder" => Spree.t(:select_a_return_authorization_reason)} %> <%= f.error_message_on :reason %> <% end %> <%= f.field_container :memo, class: ['form-group'] do %> <%= f.label :memo, Spree.t(:memo) %> <%= f.text_area :memo, :class => 'form-control' %> <%= f.error_message_on :memo %> <% end %>
<% if Spree::Config[:expedited_exchanges] %>
<%= Spree.t(:expedited_exchanges_warning, days_window: Spree::Config[:expedited_exchanges_days_window]) %>
<% end %>