<%= render :partial => 'spree/admin/shared/order_tabs', :locals => { :current => 'Customer Returns' } %> <% content_for :page_title do %> <%= Spree.t(:editing_reimbursement) %> #<%= @reimbursement.number %> <% end %> <% content_for :page_actions do %>
  • <%= button_link_to Spree.t(:back_to_customer_return), url_for([:edit, :admin, @order, @reimbursement.customer_return]), :icon => 'arrow-left' %>
  • <% end %> <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @reimbursement } %> <%= form_for [:admin, @order, @reimbursement] do |f| %>
    <%= Spree.t(:items_to_be_reimbursed) %> <%= f.fields_for :return_items, @reimbursement.return_items.sort_by(&:id) do |item_fields| %> <% return_item = item_fields.object %> <% end %>
    <%= Spree.t(:product) %> <%= Spree.t(:preferred_reimbursement_type) %> <%= Spree.t(:reimbursement_type_override) %> <%= Spree.t(:pre_tax_refund_amount) %> <%= Spree.t(:total) %> <%= Spree.t(:exchange_for) %>
    <%= return_item.inventory_unit.variant.name %>
    <%= return_item.inventory_unit.variant.options_text %>
    <%= reimbursement_type_name(return_item.preferred_reimbursement_type) %> <%= item_fields.select(:override_reimbursement_type_id, reimbursement_types.collect { |r| [r.name.humanize, r.id] }, {include_blank: true}, {class: 'select2 fullwidth'} ) %> <%= item_fields.text_field :pre_tax_amount, { class: 'refund-amount-input' } %> <%= return_item.display_total %> <% if return_item.exchange_processed? %> <%= return_item.exchange_variant.exchange_name %> <% else %> <%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants(@stock_locations), :id, :exchange_name, { include_blank: true }, { class: "select2 fullwidth return-item-exchange-selection" } %> <% end %>
    <%= f.button do %> <%= Spree.t(:update) %> <% end %>

    <% end %>
    <%= Spree.t(:calculated_reimbursements) %> <% @reimbursement_objects.each do |reimbursement_object| %> <% end %>
    <%= Spree.t(:reimbursement_type) %> <%= Spree.t(:description) %> <%= Spree.t(:amount) %>
    <%= reimbursement_object.class.name.demodulize %> <%= reimbursement_object.description %> <%= reimbursement_object.display_amount %>
    <% if @order.has_non_reimbursement_related_refunds? %> <%= "#{Spree.t('note')}: #{Spree.t('this_order_has_already_received_a_refund')}. #{Spree.t('make_sure_the_above_reimbursement_amount_is_correct')}." %> <% end %>
    <% if !@reimbursement.reimbursed? %> <%= button_to [:perform, :admin, @order, @reimbursement], {class: 'button fa fa-reply', method: 'post'} do %> <%= Spree.t(:reimburse) %> <% end %> <%= Spree.t(:or) %> <%= button_link_to Spree.t('actions.cancel'), url_for([:admin, @order, @reimbursement.customer_return]), :icon => 'remove' %> <% end %>