@extends('layouts.app') @section('style') @endsection @section('content')

{{ $batch->batch_number }}

@if($batch->current_quantity <= 0) Empty @elseif($batch->is_expired) Expired @elseif($batch->is_expiring_soon) Expiring Soon @else Active @endif {{ ucfirst($batch->quality_status) }}
${{ number_format($batch->batch_cost_price * $batch->current_quantity, 2) }}
Batch Value
Product Information
Product Name
SKU: {{ $batch->product->sku }}
Category
{{ $batch->product->category->name ?? 'N/A' }}
Brand
{{ $batch->product->brand->name ?? 'N/A' }}
Stock Information
Current Quantity
{{ $batch->current_quantity }} units
{{ $batch->current_quantity }} of {{ $batch->initial_quantity }} remaining
Reserved
{{ $batch->reserved_quantity }} units
Available
{{ $batch->available_quantity }} units
Dates Information
Manufacture Date
{{ $batch->manufacture_date ? $batch->manufacture_date->format('Y-m-d') : 'N/A' }}
Expiry Date
{{ $batch->expiry_date ? $batch->expiry_date->format('Y-m-d') : 'No Expiry' }}
@if($batch->expiry_date) {{ $batch->days_to_expiry >= 0 ? $batch->days_to_expiry . ' days remaining' : 'Expired ' . abs($batch->days_to_expiry) . ' days ago' }} @endif
Pricing Information
Cost Price
${{ number_format($batch->batch_cost_price, 2) }}
per unit
Sale Price
@if($batch->batch_sale_price) ${{ number_format($batch->batch_sale_price, 2) }} @else N/A @endif
@if($batch->batch_sale_price && $batch->batch_cost_price > 0) @php $profitMargin = (($batch->batch_sale_price - $batch->batch_cost_price) / $batch->batch_sale_price) * 100; @endphp
Profit Margin
{{ number_format($profitMargin, 1) }}%
${{ number_format($batch->batch_sale_price - $batch->batch_cost_price, 2) }} per unit
@endif
Supplier Information
@if($batch->supplier)
Supplier Name
{{ $batch->supplier->email }} | {{ $batch->supplier->phone }}
@else

No supplier assigned

@endif
Warehouse Location
@if($batch->warehouse_location)
Storage Location
{{ $batch->warehouse_location }}
@else

No location specified

@endif
Quality Control
Status
{{ ucfirst($batch->quality_status) }}
Notes
@if($batch->quality_notes) {{ $batch->quality_notes }} @else No quality notes @endif
@if($batch->notes)
Additional Notes
{{ $batch->notes }}
@endif
Stock Movements
@forelse($stockMovements as $movement) @empty @endforelse
Date Type Quantity Before Quantity Change Quantity After Reason User Reference
{{ $movement->created_at->format('Y-m-d H:i') }} {{ ucfirst($movement->movement_type) }} {{ $movement->quantity_before }} {{ $movement->formatted_quantity }} {{ $movement->quantity_after }} {{ $movement->reason ?? 'N/A' }} {{ $movement->user->name ?? 'System' }} {{ $movement->reference_number ?? 'N/A' }}

No stock movements found

@if($stockMovements->hasPages())
{{ $stockMovements->links() }}
@endif
Quick Actions
Edit Batch Details View All Product Batches @if($batch->is_expiring_soon || $batch->is_expired) @endif
Batch Statistics
{{ $batchStats['total_movements'] ?? 0 }}
Total Movements
{{ $batchStats['total_in'] ?? 0 }}
Stock In
{{ $batchStats['total_out'] ?? 0 }}
Stock Out
{{ number_format($batchStats['remaining_percentage'] ?? 0, 1) }}%
Remaining
Audit Information
Created By
{{ $batch->creator->name ?? 'System' }}
Created At
{{ $batch->created_at->format('Y-m-d H:i') }}
Last Updated
{{ $batch->updated_at->format('Y-m-d H:i') }}
@csrf @method('DELETE')
@endsection @section('script') @endsection