@extends('layouts.app') @section('title', __('rma.process_case')) @section('content')

@lang('rma.process_case') {{ $rma->rma_no }}

The page highlights the one step that can be saved next.

@lang('rma.rma_cases') @can('rma.view') @lang('messages.view') @endcan @can('rma.print') @lang('messages.print') @endcan
@if($errors->any())
Please review the information below.
@endif @component('components.widget', ['class' => 'box-primary', 'title' => __('rma.case_progress')]) @include('rma.partials.step_navigation') @endcomponent @component('components.widget', ['class' => 'box-primary', 'title' => __('rma.case_summary')])
@lang('rma.sale_invoice')
{{ optional($rma->sale)->invoice_no }}
@lang('rma.customer')
{{ optional($rma->customer)->supplier_business_name ?: optional($rma->customer)->name }}
@lang('rma.status')
{{ \App\Rma::statuses()[$rma->status] ?? $rma->status }} @if(!empty($rma->review_required_from_step))@lang('rma.needs_review')@endif
@lang('rma.after_sales_location')
{{ optional($rma->after_sales_location)->name }}
@endcomponent @if(!$can_edit_step)
{{ $rma->status === 'completed' ? __('rma.completed_case_notice') : __('rma.view_only_step_notice') }} @if(auth()->user()->can('rma.reopen') && auth()->user()->can('rma.update')) @lang('rma.reopen_step') → @endif
@endif {!! Form::open(['url' => action([\App\Http\Controllers\RmaController::class, 'update'], [$rma->id]), 'method' => 'PUT', 'files' => true]) !!} {!! Form::hidden('step', $step) !!}
@if($step === 1) @component('components.widget', ['class' => 'box-primary', 'title' => __('rma.steps.intake')])
@lang('rma.step_help.intake') @lang('rma.intake_quantity_help')
@php $location_locked = $rma->stock_movements->isNotEmpty() || $rma->items->contains(function ($row) { return (float) ($row->qty_moved_to_rma_location ?? 0) > 0 || (float) ($row->qty_removed_from_rma_location_by_supplier ?? 0) > 0 || (float) ($row->qty_added_to_origin_location_by_supplier ?? 0) > 0; }); $location_attributes = ['class' => 'form-control select2', 'style' => 'width:100%']; if ($location_locked) { $location_attributes['disabled'] = true; } @endphp
{!! Form::label('after_sales_location_id', __('rma.after_sales_location') . ':') !!} {!! Form::select('after_sales_location_id', $business_locations, $rma->after_sales_location_id, $location_attributes) !!} @if($location_locked) {!! Form::hidden('after_sales_location_id', $rma->after_sales_location_id) !!} @lang('rma.location_locked_notice') @else @lang('rma.case_setup_guidance') @endif
@foreach($rma->items as $item) @php $variation_parts = []; $customer_outcome = $item->customer_outcome === 'return' ? 'refund' : $item->customer_outcome; $customer_outcome = $customer_outcome === 'replacement' ? 'exchange' : $customer_outcome; if (optional($item->product)->type == 'variable' && !empty($item->variation) && !empty($item->variation->product_variation)) { $variation_parts[] = $item->variation->product_variation->name; if ($item->variation->name !== $item->variation->product_variation->name) { $variation_parts[] = $item->variation->name; } } @endphp @endforeach
@lang('product.product_name') @lang('rma.quantity') @lang('rma.issue_type') @lang('rma.reason') @lang('rma.issue_note') @lang('rma.condition_note') @lang('rma.picture')
{{ optional($item->product)->name }} @if(!empty($variation_parts))
{{ implode(' - ', $variation_parts) }} @endif
{!! Form::number("items[$item->id][quantity]", $item->quantity, ['class' => 'form-control', 'step' => '0.01', 'min' => '0.01']) !!} @error("items.$item->id.quantity"){{ $message }}@enderror {!! Form::select("items[$item->id][issue_type]", \App\RmaItem::issueTypes(), $item->issue_type, ['class' => 'form-control select2', 'style' => 'width:100%']) !!} {!! Form::select("items[$item->id][reason]", \App\RmaItem::intakeReasons(), $item->reason, ['class' => 'form-control select2', 'style' => 'width:100%']) !!} {!! Form::textarea("items[$item->id][issue_note]", $item->issue_note, ['class' => 'form-control', 'rows' => 2]) !!} {!! Form::textarea("items[$item->id][condition_note]", $item->condition_note, ['class' => 'form-control', 'rows' => 2]) !!} @if($item->media->first()) @lang('messages.view')
@endif
@endcomponent @elseif($step === 2) @component('components.widget', ['class' => 'box-primary', 'title' => __('rma.steps.customer_outcome')])
@lang('rma.customer_outcome_guidance')
@php $customer_outcome_options = \App\RmaItem::customerOutcomes(); if (! auth()->user()->can('rma.exchange_replacement')) { unset($customer_outcome_options['exchange'], $customer_outcome_options['replacement']); } @endphp
@foreach($rma->items as $item) @php $variation_parts = []; $customer_outcome = $item->customer_outcome === 'return' ? 'refund' : $item->customer_outcome; $customer_outcome = $customer_outcome === 'replacement' ? 'exchange' : $customer_outcome; if (optional($item->product)->type == 'variable' && !empty($item->variation) && !empty($item->variation->product_variation)) { $variation_parts[] = $item->variation->product_variation->name; if ($item->variation->name !== $item->variation->product_variation->name) { $variation_parts[] = $item->variation->name; } } @endphp @endforeach
@lang('product.product_name') @lang('rma.customer_outcome') @lang('rma.linked_customer_transaction_id') @lang('rma.customer_reference') @lang('rma.repair_note')
{{ optional($item->product)->name }} @if(!empty($variation_parts))
{{ implode(' - ', $variation_parts) }} @endif
{!! Form::select("items[$item->id][customer_outcome]", $customer_outcome_options, $customer_outcome, ['class' => 'form-control select2 rma-customer-outcome', 'style' => 'width:100%', 'placeholder' => __('messages.please_select')]) !!} {!! Form::hidden("items[$item->id][linked_customer_transaction_id]", $item->linked_customer_transaction_id, ['class' => 'rma-linked-customer-transaction-id']) !!}
{!! Form::text("items[$item->id][customer_document_display]", $item->customer_outcome_reference, ['class' => 'form-control rma-customer-document-display', 'readonly' => true, 'placeholder' => __('rma.choose_customer_document')]) !!}
@lang('rma.choose_outcome_first')
{!! Form::text("items[$item->id][customer_outcome_reference]", $item->customer_outcome_reference, ['class' => 'form-control rma-customer-reference', 'readonly' => true, 'placeholder' => __('rma.customer_reference')]) !!} {!! Form::textarea("items[$item->id][repair_note]", $item->repair_note, ['class' => 'form-control', 'rows' => 2]) !!}
@endcomponent @elseif($step === 3) @component('components.widget', ['class' => 'box-primary', 'title' => __('rma.steps.supplier_rma')])
@lang('rma.supplier_outcome_guidance')
@foreach($rma->items as $item) @php $variation_parts = []; if (optional($item->product)->type == 'variable' && !empty($item->variation) && !empty($item->variation->product_variation)) { $variation_parts[] = $item->variation->product_variation->name; if ($item->variation->name !== $item->variation->product_variation->name) { $variation_parts[] = $item->variation->name; } } @endphp @endforeach
@lang('product.product_name') @lang('rma.supplier') @lang('rma.supplier_outcome') @lang('rma.supplier_reference') @lang('rma.linked_supplier_transaction_id')
{{ optional($item->product)->name }} @if(!empty($variation_parts))
{{ implode(' - ', $variation_parts) }} @endif
{!! Form::select("items[$item->id][supplier_id]", $suppliers, $item->supplier_id, ['class' => 'form-control select2', 'style' => 'width:100%', 'placeholder' => __('messages.please_select')]) !!} {!! Form::select("items[$item->id][supplier_outcome]", \App\RmaItem::supplierOutcomes(), $item->supplier_outcome, ['class' => 'form-control select2', 'style' => 'width:100%', 'placeholder' => __('messages.please_select')]) !!} {!! Form::text("items[$item->id][supplier_outcome_reference]", $item->supplier_outcome_reference, ['class' => 'form-control', 'placeholder' => __('rma.supplier_reference')]) !!} {!! Form::text("items[$item->id][linked_supplier_transaction_id]", $item->linked_supplier_transaction_id, ['class' => 'form-control', 'placeholder' => __('rma.linked_supplier_transaction_id')]) !!}
@endcomponent @else @component('components.widget', ['class' => 'box-primary', 'title' => __('rma.steps.closure')])
@lang('rma.closure_guidance')
{!! Form::label('final_note', __('rma.final_note') . ':') !!} {!! Form::textarea('final_note', $rma->final_note, ['class' => 'form-control', 'rows' => 5]) !!}
@include('rma.partials.item_summary_table') @endcomponent @endif
@if($can_edit_step) @component('components.widget', ['class' => 'box-primary', 'title' => __('rma.internal_note')])

Add an optional note so the next person understands what was checked or changed.

{!! Form::textarea('internal_note', old('internal_note'), ['class' => 'form-control', 'rows' => 3, 'placeholder' => 'Optional note for your team']) !!}
@endcomponent @endif {!! Form::close() !!} @if($step === 2) @endif @component('components.widget', ['class' => 'box-default', 'title' => __('rma.items')])

@lang('rma.items_guidance')

@include('rma.partials.item_summary_table') @endcomponent @component('components.widget', ['class' => 'box-default', 'title' => __('rma.inventory_movements')]) @include('rma.partials.inventory_movements') @endcomponent @can('rma.audit.view') @component('components.widget', ['class' => 'box-default', 'title' => __('rma.activity_timeline')]) @include('rma.partials.audit_trail') @endcomponent @endcan
@endsection @section('javascript') @endsection