@extends('layouts.app')
@section('content')
@php
$productsForJs = $products->map(function ($product) {
return [
'id' => $product->id,
'name' => $product->name,
'material_ids' => $product->materials->pluck('id')->values()->toArray(),
];
})->values()->toArray();
$materialsForJs = collect($materialsJson ?? [])->values()->toArray();
$itemsForJs = collect($itemsJson ?? [])->values()->toArray();
$customersForJs = $customers->map(function ($customer) {
return [
'id' => $customer->id,
'name' => $customer->name,
'member_type' => $customer->member_type,
'phone' => $customer->phone ?? '',
'contact_person' => $customer->contact_person ?? '',
'npwp' => $customer->npwp ?? '',
'email' => $customer->email ?? '',
];
})->values()->toArray();
$customersMapForJs = $customers->mapWithKeys(function ($customer) {
return [$customer->id => $customer->member_type];
})->toArray();
$loggedInUserName = auth()->user()->name ?? auth()->user()->email ?? 'User';
$initialCustomerId = old('customer_id', $order->customer_id ?? '');
@endphp
Mode Input Cepat — akurasi dulu, baru ngebut.
Urutan aman: Nama Pemesan → Produk → Bahan → Nama File → Unit → Ukuran (jika meter/m²) → Qty → Sisi → Harga → Catatan finishing. Kalau ragu, tulis catatan finishing biar produksi nggak salah tafsir.
Edit order #{{ $order->invoice_number }}. Tampilan dibuat sama seperti create order.