@extends('layouts.app', ['class' => 'g-sidenav-show bg-gray-100']) @section('content') @include('layouts.navbars.auth.topnav', ['title' => 'Generate PPS']) {{-- ── Topbar Buttons ── --}}
@csrf {{-- ── CARD 1: Mode Toggle + Pilih ID PS ────────────────────────────── --}}
Generate PPS / SJS

@include('components.alert') {{-- Toggle di atas --}}
Aktif: Pilih dari daftar ID PS yang tersedia.  |  Non-aktif: Input PPS secara manual.
{{-- Section: Pilih ID PS (tampil saat toggle ON) --}}
@if ($list_ps->isEmpty()) Semua ID PS sudah memiliki PPS aktif. @endif
{{-- ── CARD 2: Detail PS (auto-fill setelah pilih id_ps) ──────── --}}
Informasi Picking Slip

{{-- ── CARD 3: Item PS ─────────────────────────────────────────── --}}
Item / Material

No
PP/PET Gsm No Roll No Jumbo Color Width Length Grade Qty UOM Remark
Pilih ID PS terlebih dahulu.
0 item dipilih
Semua material pada ID PS ini telah terisi penuh.
{{-- ── CARD MANUAL ENTRY (tampil saat toggle OFF) ─────────────── --}}
{{-- MODAL PREVIEW ITEMS --}} {{-- Data PS dan Item (JS lookup) --}} @php // Encode data untuk dipakai JS: map id_ps → detail item $psItemsJs = []; foreach ($list_ps_items as $idPs => $items) { $psItemsJs[$idPs] = $items ->map(function ($item) { return [ 'detail_id' => $item->detail_id, 'item_number' => $item->item_number, 'material_code' => $item->material_code, 'gsm' => $item->gsm ?? '', 'no_roll' => $item->no_roll ?? '', 'no_jumbo' => $item->no_jumbo ?? '', 'color' => $item->color ?? '', 'width' => $item->width ?? '', 'length' => $item->length ?? '', 'grade' => $item->grade ?? '', 'sales_unit' => $item->sales_unit ?? '', 'qty_sales' => $item->qty_sales ?? '', 'qty_sent_total' => $item->qty_sent_total ?? 0, 'qty_remaining' => $item->qty_remaining ?? ($item->qty_sales ?? 0), 'remark' => $item->remark ?? '', 'item_status' => $item->item_status ?? 'notset', 'no_pps_existing' => $item->no_pps_existing, 'flag_rejection' => $item->flag_rejection ?? '0', 'sumber_material' => $item->sumber_material ?? '', 'can_create_pps' => (int) ($item->can_create_pps ?? 1), ]; }) ->values() ->toArray(); } @endphp @push('css') @endpush @push('js') @endpush @endsection