<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: 'Customer Returns' } %> <% admin_breadcrumb("#{t('spree.editing_reimbursement')} #{@reimbursement.number}") %> <% content_for :page_actions do %>
  • <%= link_to t('spree.back_to_customer_return'), url_for([:edit, :admin, @order, @reimbursement.customer_return]), class: 'btn btn-primary' %>
  • <% end %> <%= render partial: 'spree/shared/error_messages', locals: { target: @reimbursement } %> <%= form_for [:admin, @order, @reimbursement] do |f| %>
    <%= t('spree.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::Product.model_name.human %> <%= Spree::ReturnItem.human_attribute_name(:preferred_reimbursement_type_id) %> <%= Spree::ReturnItem.human_attribute_name(:override_reimbursement_type_id) %> <%= Spree::ReturnItem.human_attribute_name(:amount) %> <%= Spree::ReturnItem.human_attribute_name(:total) %> <%= Spree::ReturnItem.human_attribute_name(:exchange_variant) %>
    <%= 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: 'custom-select fullwidth'} ) %> <%= item_fields.text_field :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: "custom-select fullwidth return-item-exchange-selection" } %> <% end %>
    <%= f.button do %> <%= t('spree.update') %> <% end %>

    <% end %>
    <%= t('spree.calculated_reimbursements') %> <% @reimbursement_objects.each do |reimbursement_object| %> <% end %>
    <%= Spree::ReimbursementType.model_name.human %> <%= t('spree.description') %> <%= Spree::Reimbursement.human_attribute_name(:total) %>
    <%= reimbursement_object.class.name.demodulize %> <%= reimbursement_object.description %> <%= reimbursement_object.display_amount %>
    <% if @order.has_non_reimbursement_related_refunds? %> <%= t('spree.note_already_received_a_refund') %> <% end %>
    <% if !@reimbursement.reimbursed? %> <%= button_to [:perform, :admin, @order, @reimbursement], { class: 'button btn btn-primary', method: 'post' } do %> <%= t('spree.reimburse') %> <% end %> <%= link_to t('spree.actions.cancel'), url_for([:edit, :admin, @order, @reimbursement.customer_return]), class: 'btn btn-default' %> <% end %>