@extends('layouts.inspinia') @section('title', 'Create Gate Pass') @section('content_header', 'Create Gate Pass') @section('breadcrumb') @endsection @section('content') @if($errors->any())
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Stock control notice --}}
Gate Pass — Physical Stock Exit Control
Flow: Sales Order → Customer Dispatch → Gate Pass (this record) → Delivery Note → Tax Invoice → Receipt
Gate Pass Details
{{-- Dispatch Summary --}}

Customer Dispatch: {{ $dispatch->dispatch_number }}

Sales Order: {{ $dispatch->salesOrder->sales_order_number ?? '—' }}

Customer: {{ $dispatch->salesOrder->customer->name ?? '—' }}

Salesman: {{ $dispatch->salesOrder->salesman->name ?? '—' }}

Issuing Warehouse / Store: {{ $dispatch->fromWarehouse->name ?? '—' }}

Dispatch Date: {{ $dispatch->dispatch_date?->format('d-m-Y') }}

Dispatch Status: {{ strtoupper(str_replace('_', ' ', $dispatch->status)) }}

@csrf
@error('gate_pass_date') {{ $message }} @enderror
@error('destination_name') {{ $message }} @enderror
@error('security_officer_name') {{ $message }} @enderror
@error('vehicle_number') {{ $message }} @enderror
@error('driver_name') {{ $message }} @enderror
@error('driver_phone') {{ $message }} @enderror
@error('remarks') {{ $message }} @enderror
{{-- Items from Dispatch (read-only) --}}
Items for Gate Pass

Items are carried over from the completed customer dispatch. Quantities reflect goods prepared / issued from the warehouse. Stock will not be physically deducted until Gate Pass release is enabled.

@forelse($dispatch->items as $item) @empty @endforelse
Item Description Requested / Prepared Qty Qty for Gate Pass
{{ $item->item->name ?? '—' }} @if($item->itemAlias) — {{ $item->itemAlias->alias_name }} @endif {{ $item->description ?? '—' }} {{ number_format($item->quantity_requested, 2) }} {{ number_format($item->quantity_transferred, 2) }}
No items on this dispatch.
Back to Dispatch
@endsection