@extends('layouts.layoutMaster') @section('title', 'Laporan Batch') @section('vendor-style') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss', 'resources/assets/vendor/libs/select2/select2.scss', 'resources/assets/vendor/libs/sweetalert2/sweetalert2.scss' ]) @endsection @section('vendor-script') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js', 'resources/assets/vendor/libs/select2/select2.js', 'resources/assets/vendor/libs/sweetalert2/sweetalert2.js' ]) @endsection @section('content')
{{ $totalBatches }}

Total Batch

Rp {{ number_format($totalValue, 0, ',', '.') }}

Nilai Total

{{ $expiredBatches }}

Batch Kadaluarsa

{{ $expiringBatches }}

Segera Kadaluarsa

Filter & Aksi
Reset
Daftar Batch
{{ $batches->total() }} Total
@foreach($batches as $batch) @endforeach @if($batches->count() == 0) @endif
Bahan Batch ID Gudang Stok Harga Unit Nilai Total Kadaluarsa Status Aksi
{{ $batch->ingredient->name ?? 'N/A' }} {{ $batch->id }} {{ $batch->warehouse->name ?? 'N/A' }} {{ number_format($batch->remaining_stock, 2) }} Rp {{ number_format($batch->unit_price, 0, ',', '.') }} Rp {{ number_format($batch->remaining_stock * $batch->unit_price, 0, ',', '.') }} @if($batch->expiry_date) {{ \Carbon\Carbon::parse($batch->expiry_date)->format('d M Y') }} @else N/A @endif @php $now = now(); $expiryDate = $batch->expiry_date ? \Carbon\Carbon::parse($batch->expiry_date) : null; if (!$expiryDate) { $status = 'active'; $statusText = 'Aktif'; $badgeClass = 'bg-success'; } elseif ($expiryDate->isPast()) { $status = 'expired'; $statusText = 'Kadaluarsa'; $badgeClass = 'bg-danger'; } elseif ($expiryDate->diffInDays($now) <= 30) { $status = 'expiring'; $statusText = 'Segera Kadaluarsa (' . $expiryDate->diffInDays($now) . ' hari)'; $badgeClass = 'bg-warning'; } else { $status = 'active'; $statusText = 'Aktif'; $badgeClass = 'bg-success'; } @endphp {{ $statusText }}
Tidak ada data batch ditemukan
@endsection @section('page-script') @endsection