@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => $title ?? 'Penerimaan Barang'])
@php $formatBerat = function ($value) { if ($value === null || $value === '') { return '-'; } $formatted = number_format((float) $value, 3, ',', '.'); return rtrim(rtrim($formatted, '0'), ','); }; @endphp

{{ $title ?? 'Detail Penerimaan' }}

Informasi lengkap batch dan progress penerimaan.

@if (in_array($batch->status, ['PLANNED', 'IN_PROGRESS'])) Proses Receiving @endif @if ($batch->status === 'PLANNED') Edit @endif @if ($bags->count() > 0) Cetak Label @endif @if ($bags->count() > 0) Cetak Dokumen @endif
{{-- Summary Cards --}}
@php $statusColors = [ 'PLANNED' => 'bg-info', 'IN_PROGRESS' => 'bg-warning', 'RECEIVED' => 'bg-success', 'CANCELLED' => 'bg-danger', ]; $statusColor = $statusColors[$batch->status] ?? 'bg-secondary'; @endphp {{ $batch->status }}

{{ $progress['percentage'] }}%

{{ $progress['total_received'] }}/{{ $progress['total_planned'] }} bag

{{ $summary['total_bags'] }}

{{ number_format($summary['total_berat']) }} kg

{{ $summary['printed'] }} {{ $summary['not_printed'] }}
@if ($batch->receive_mode == 'GENERATE') GENERATE @else USE VENDOR ID @endif
Informasi Batch
  • Batch ID: {{ $batch->batch_id }}
  • Tgl Rencana: {{ $batch->planned_date ? \Carbon\Carbon::parse($batch->planned_date)->format('d M Y') : '-' }}
  • Tgl Diterima: {{ $batch->received_date ? \Carbon\Carbon::parse($batch->received_date)->format('d M Y') : '-' }}
  • Tipe Penerimaan: {{ $batch->in_type_name ?? '-' }}
  • PIC Pengirim: {{ $batch->pic_pengirim_name ?? '-' }}
  • PIC Penerima: {{ $batch->pic_penerima_name ?? '-' }}
  • Dibuat oleh: {{ $batch->planned_by_name ?? ($batch->user_create ?? '-') }}
  • Diterima oleh: {{ $batch->received_by_name ?? '-' }}
  • Catatan: {{ $batch->remarks ?? '-' }} @if ($batch->remarks) @endif
@php $vendorDetails = $vendorDetails ?? collect(); $vendorCount = $vendorDetails->count(); @endphp
Vendor Detail
@if ($vendorCount > 1)
1/{{ $vendorCount }}
@endif
@forelse ($vendorDetails as $index => $vendorDetail)

{{ $vendorDetail->vendor_name ?? '-' }}

{{ $vendorDetail->vendor_address ?? '-' }}

{{ $vendorDetail->vendor_phone ?? '-' }}

Material:
    @foreach ($vendorDetail->materials as $material)
  • {{ $material }}
  • @endforeach
@empty

{{ $batch->vendor_name ?? '-' }}

{{ $batch->vendor_address ?? '-' }}

{{ $batch->vendor_phone ?? '-' }}

@endforelse
{{-- Plan Items Progress --}}
Progress Penerimaan per Material
@foreach ($planItems as $item) @php $remaining = $item->qty_planned - $item->qty_received; $pct = $item->qty_planned > 0 ? round(($item->qty_received / $item->qty_planned) * 100) : 0; $progressColor = $pct >= 100 ? 'success' : ($pct > 0 ? 'info' : 'secondary'); $isOver = $item->qty_received > $item->qty_planned; @endphp
{{ $item->sku_code }} {{ $item->nama_material }} @if ($item->color_name) ({{ $item->color_name }}) @endif @if ($item->berat_per_bag) {{ $formatBerat($item->berat_per_bag) }} kg/bag @endif
{{ $item->qty_received }} / {{ $item->qty_planned }} bag @if ($remaining > 0) sisa {{ $remaining }} @elseif ($isOver) over +{{ abs($remaining) }} @else selesai @endif
@if ($item->notes) {{ $item->notes }} @endif
@endforeach @if ($planItems->isEmpty())

Belum ada rencana material

@endif
{{-- Bag List --}}
Daftar Bag yang Sudah Diterima
@forelse ($bags as $index => $bag) @php $isWaitingApproval = !empty($bag->pending_approval); $isPlaced = !empty($bag->placed_at) || $bag->status !== 'PENDING'; $rowClass = ''; $statusText = 'Belum Layouting'; $statusClass = 'bg-light text-secondary'; if ($isWaitingApproval) { $rowClass = 'bag-row-waiting'; $statusText = 'Menunggu Approval Layout'; $statusClass = 'badge-soft-warning'; } elseif ($isPlaced) { $rowClass = 'bag-row-placed'; $statusText = 'Sudah Layouting'; $statusClass = 'badge-soft-success'; } $layoutInfo = $bag->nama_layout ?? ($bag->current_layout_id ?? '-'); $displayBagCode = $bag->barcode_value ?: '-'; @endphp @empty @endforelse
No {{ $batch->receive_mode === 'USE_VENDOR_ID' ? 'QR/Barcode Vendor' : 'Bag ID' }} Material Info Berat Per Bag (kg) Status Layout/Lokasi Print
{{ $index + 1 }}
{{ $displayBagCode }} {{-- @if ($batch->receive_mode === 'USE_VENDOR_ID') Bag ID: {{ $bag->bag_id }} @endif --}}
{{ $bag->sku_code }} {{ $bag->nama_material }} ({{ $bag->color_name ?? '-' }})
{{ $formatBerat($bag->berat) }} {{-- {{ $bag->satuan_name }} --}}
{{ $statusText }}
{{ $layoutInfo }} @if ($bag->qr_printed) @else @endif
{{-- Modal Remarks --}} @endsection @push('js') @endpush @push('js') @endpush