@extends('layouts.admin') @section('title', 'Edit Produk') @section('content')

Edit Produk Jasa

@csrf @method('PUT') @if(isset($queryParams)) @foreach($queryParams as $key => $value) @if($value) @endif @endforeach @endif

Informasi Dasar Produk

@error('product_title')

{{ $message }}

@enderror
@error('product_description')

{{ $message }}

@enderror
@error('category_id')

{{ $message }}

@enderror
@error('product_work_duration')

{{ $message }}

@enderror
@error('product_garansi')

{{ $message }}

@enderror
Nonaktif akan menyembunyikan produk dari daftar.

Tambahkan bahan yang diperlukan untuk produk ini. Anda bisa mengisi nama bahan bebas.

@php $materialIndex = 0; @endphp @forelse(($product->materials ?? []) as $selectedMaterial)
@php $materialIndex++; @endphp @empty @endforelse

Tambahkan sparepart yang diperlukan untuk produk ini. Anda bisa mengisi nama sparepart bebas.

@php $sparepartIndexPrefill = 0; @endphp @forelse(($product->spareparts ?? []) as $selectedSparepart)
@php $sparepartIndexPrefill++; @endphp @empty @endforelse

Tambahkan spesifikasi seperti dimensi, kapasitas, dll.

@php $specIndexPrefill = 0; @endphp @forelse(($product->specifications ?? []) as $spec)
@php $specIndexPrefill++; @endphp @empty @endforelse

Kalkulasi Biaya Produk

@error('product_prices')

{{ $message }}

@enderror
@if(isset($mismatchedProductions) && $mismatchedProductions->count() > 0)

Peringatan: Ada {{ $mismatchedProductions->count() }} produksi dengan labor cost berbeda!

Upah jasa yang Anda input (Rp {{ number_format($product->service_fee ?? 0, 0, ',', '.') }}) tidak sesuai dengan labor cost yang diinput teknisi pada beberapa produksi. Pertimbangkan untuk memperbarui nilai ini.

@foreach($mismatchedProductions->take(5) as $production)
Production #{{ $production->id }} @if($production->order) - Order #{{ $production->order->order_number ?? $production->order->id }} @endif
Rp {{ number_format($production->labor_cost, 0, ',', '.') }}
Default: Rp {{ number_format($product->service_fee ?? 0, 0, ',', '.') }} Selisih: {{ $production->labor_cost > ($product->service_fee ?? 0) ? '+' : '' }}Rp {{ number_format(abs($production->labor_cost - ($product->service_fee ?? 0)), 0, ',', '.') }} @if($production->notes)
{{ Str::limit($production->notes, 50) }}
@endif
@endforeach @if($mismatchedProductions->count() > 5)

... dan {{ $mismatchedProductions->count() - 5 }} produksi lainnya

@endif
@endif

Ringkasan Biaya & Keuntungan:

Upah Jasa: Rp 0

Harga Jual Produk: Rp 0

Keuntungan: Rp 0
Persentase Keuntungan: 0%

Unggah minimal 1 gambar (jpg, jpeg, png, max 2MB).

@error('product_image')

{{ $message }}

@enderror
product_image && file_exists(public_path('uploads/products/' . $product->product_image))) src="{{ asset('uploads/products/' . $product->product_image) }}" style="background: transparent;" @else style="background: transparent;" @endif>
@if($product->images && $product->images->count() > 0)
@foreach($product->images as $img)
Gambar
@endforeach
@endif
Batal
@endsection