@extends('layouts.app') @section('title', __('shop_rma.view_case')) @section('content')

@lang('shop_rma.view_case') {{ $shop_rma->shop_rma_no }}

@lang('shop_rma.no_customer_notice')

@lang('shop_rma.cases') @can('shop_rma.update') @if(in_array($shop_rma->status, ['open', 'sent', 'resolved'], true)) @lang('shop_rma.continue_case') @endif @endcan @can('shop_rma.print') @lang('shop_rma.print_supplier_copy') @endcan
@include('shop_rma.partials.progress') @component('components.widget', ['class' => 'box-primary', 'title' => __('shop_rma.view_case')])
@lang('shop_rma.supplier')
{{ optional($shop_rma->supplier)->supplier_business_name ?: optional($shop_rma->supplier)->name }}
@if(!empty(optional($shop_rma->supplier)->supplier_business_name) && optional($shop_rma->supplier)->name !== optional($shop_rma->supplier)->supplier_business_name)
{{ optional($shop_rma->supplier)->name }}
@endif
@lang('shop_rma.shop_location')
{{ optional($shop_rma->location)->name }}
@lang('shop_rma.rma_location')
{{ optional($shop_rma->rma_location)->name }}
@lang('shop_rma.status')
{{ \App\ShopRma::statuses()[$shop_rma->status] ?? $shop_rma->status }}

@lang('shop_rma.supplier_reference')
{{ $shop_rma->supplier_reference ?: '—' }}
@lang('shop_rma.sent_at')
{{ !empty($shop_rma->sent_at) ? @format_datetime($shop_rma->sent_at) : '—' }}
@lang('shop_rma.courier') / @lang('shop_rma.tracking_no')
{{ $shop_rma->courier ?: '—' }} @if(!empty($shop_rma->tracking_no)) · {{ $shop_rma->tracking_no }} @endif
@lang('report.user') / @lang('messages.date')
{{ optional($shop_rma->created_by_user)->user_full_name ?? optional($shop_rma->created_by_user)->first_name }}
{{ @format_datetime($shop_rma->created_at) }}
@if(!empty($shop_rma->resolution_note) || !empty($shop_rma->final_note))
@if(!empty($shop_rma->resolution_note))

@lang('shop_rma.resolution_note'): {{ $shop_rma->resolution_note }}

@endif @if(!empty($shop_rma->final_note))

@lang('shop_rma.final_note'): {{ $shop_rma->final_note }}

@endif @endif @endcomponent @component('components.widget', ['class' => 'box-primary', 'title' => __('shop_rma.items')]) @include('shop_rma.partials.items') @endcomponent @component('components.widget', ['class' => 'box-primary', 'title' => __('shop_rma.stock_movements')])
@forelse($shop_rma->stock_movements as $movement) @empty @endforelse
@lang('messages.date')@lang('product.product_name')Movement@lang('shop_rma.quantity_to_return')@lang('report.user')
{{ @format_datetime($movement->created_at) }} {{ optional(optional($movement->item)->product)->name }} {{ __('shop_rma.movement_types.'.$movement->movement_type) }}
{{ optional($movement->from_location)->name ?: 'Supplier' }} → {{ optional($movement->to_location)->name ?: 'Supplier' }} @if(!empty($movement->notes))
{{ $movement->notes }}@endif
{{ @format_quantity($movement->quantity) }} {{ optional($movement->created_by_user)->user_full_name ?? optional($movement->created_by_user)->first_name }}
@lang('messages.no_data')
@endcomponent @can('shop_rma.audit.view') @component('components.widget', ['class' => 'box-primary', 'title' => __('shop_rma.audit_trail')])
@forelse($shop_rma->audits as $audit)
{{ __('shop_rma.audit_actions.'.$audit->action) }}
{{ @format_datetime($audit->created_at) }} · {{ optional($audit->user)->user_full_name ?? optional($audit->user)->first_name }}
@if(!empty($audit->internal_note))
{{ $audit->internal_note }}
@endif
@empty

@lang('messages.no_data')

@endforelse
@endcomponent @endcan
@endsection