@extends('layouts.app') @section('title', 'Movement ' . $movement->movement_id) @section('content') @php $isItemMovement = filled($movement->serial_number); $targetMasterCode = null; if ($movement->to_location_type === 'MASTER_ID' && preg_match('/Transfer to Master ID:\s*([^.\n\r]+)/', $movement->reason ?? '', $matches)) { $targetMasterCode = trim($matches[1]); } @endphp
Back to Movements

Movement: {{ $movement->movement_id }}

@if($isItemMovement) Item Movement @else Master ID Movement @endif
View Master Device @if($targetMasterCode) View Target Master @endif @if(auth()->user()?->isAdmin() || auth()->user()?->isManager() || ($movement->requested_by === auth()->id() && $movement->status === 'PENDING'))
@csrf @method('DELETE')
@endif
{{-- Dedicated Component Item Card (Shown only for Item Movements) --}} @if($isItemMovement)
Moved Component Item Serialized equipment moved independently
Component Type {{ $movement->equipment_type }}
Serial Number {{ $movement->serial_number }}
@endif
Movement Details
Movement ID {{ $movement->movement_id }}
Movement Type @if($isItemMovement) Item Transfer ({{ $movement->equipment_type }}) @else Full Master ID Package @endif
Master ID {{ $movement->rental_device_code }} @if($movement->rentalDevice && $movement->rentalDevice->customer) ({{ $movement->rentalDevice->customer->customer_name }}) @endif
Status @switch($movement->status) @case('PENDING') PENDING @break @case('APPROVED') APPROVED @break @case('REJECTED') REJECTED @break @case('COMPLETED') COMPLETED @break @default {{ $movement->status }} @endswitch
Requested By {{ $movement->requester->name ?? '-' }}
Approved By {{ $movement->approver->name ?? '-' }}
Requested Date {{ $movement->created_at->format('d M Y H:i') }}
Last Updated {{ $movement->updated_at->format('d M Y H:i') }}
Location Trajectory
{{-- From Location --}}
ORIGIN {{ $movement->from_location_type }}
@if($movement->from_location_type === 'WAREHOUSE')
{{ $movement->fromWarehouse->warehouse_name ?? 'Warehouse' }}
@if($movement->fromZone) Zone: {{ $movement->fromZone->zone_code }} @endif @if($movement->fromRack) | Rack: {{ $movement->fromRack->rack_code }} @endif @if($movement->fromShelf) | Shelf: {{ $movement->fromShelf->shelf_code }} @endif
@elseif($movement->from_location_type === 'SITE')
{{ $movement->fromSite->site_name ?? 'Site' }}
@if($movement->fromSite && $movement->fromSite->city)
{{ $movement->fromSite->city }}
@endif @else
-
@endif
{{-- Arrow Indicator --}}
{{-- To Location --}}
DESTINATION {{ $movement->to_location_type }}
@if($movement->to_location_type === 'MASTER_ID')
Master ID: {{ $targetMasterCode ?? 'Another Master' }}
@if($targetMasterCode) Open Target Master Profile @endif @elseif($movement->to_location_type === 'WAREHOUSE')
{{ $movement->toWarehouse->warehouse_name ?? 'Warehouse' }}
@if($movement->toZone) Zone: {{ $movement->toZone->zone_code }} @endif @if($movement->toRack) | Rack: {{ $movement->toRack->rack_code }} @endif @if($movement->toShelf) | Shelf: {{ $movement->toShelf->shelf_code }} @endif
@elseif($movement->to_location_type === 'SITE')
{{ $movement->toSite->site_name ?? 'Site' }}
@if($movement->toSite && $movement->toSite->city)
{{ $movement->toSite->city }}
@endif @else
-
@endif
Reason & Notes

{{ $movement->reason ?? 'No reason provided.' }}

Summary
@if($isItemMovement) @endif
Type @if($isItemMovement) Item Transfer @else Master ID @endif
Status @switch($movement->status) @case('PENDING') PENDING @break @case('APPROVED') APPROVED @break @case('REJECTED') REJECTED @break @case('COMPLETED') COMPLETED @break @default {{ $movement->status }} @endswitch
Master Device {{ $movement->rental_device_code }}
Component {{ $movement->equipment_type }}
Serial No {{ $movement->serial_number }}
Requested {{ $movement->created_at->format('d M Y') }}
Quick Actions
New Movement Request View Approvals @if(auth()->user()?->isAdmin() || auth()->user()?->isManager() || ($movement->requested_by === auth()->id() && $movement->status === 'PENDING'))
@csrf @method('DELETE')
@endif
@endsection