@extends('layouts.app') @section('title','Detail Order Servis') @section('page-title','Detail Order Servis') @push('head') @endpush @section('content') @php $phone = preg_replace('/[^0-9]/', '', $order->customer?->phone ?? ''); if ($phone && str_starts_with($phone, '0')) $phone = '62' . substr($phone, 1); $spTotal = $order->sparparts->sum('subtotal'); $chTotal = $order->charges->sum('amount'); $finalCost = $order->final_cost ?? $order->calculateFinalCost(); $waLines = []; $waLines[] = "Halo {$order->customer?->name},"; $waLines[] = ""; $waLines[] = "Berikut informasi servis Anda di GMComp:"; $waLines[] = ""; $waLines[] = "π No. Nota: {$order->order_number}"; $waLines[] = "π Tanggal Masuk: {$order->received_at->format('d/m/Y')}"; $waLines[] = "π» Perangkat: {$order->device_type} {$order->device_brand} {$order->device_model}"; $waLines[] = "π§ Keluhan: {$order->complaint}"; $waLines[] = "β Status: {$order->status_label}"; $waLines[] = ""; $waLines[] = "π° Rincian Biaya:"; if ($spTotal > 0) $waLines[] = "- Sparepart: Rp " . number_format($spTotal, 0, ',', '.'); if ($chTotal > 0) $waLines[] = "- Jasa Servis: Rp " . number_format($chTotal, 0, ',', '.'); $waLines[] = "- *TOTAL: Rp " . number_format($finalCost, 0, ',', '.') . "*"; $waLines[] = ""; $waLines[] = "π‘οΈ Garansi servis: {$order->warranty_service_days} hari"; $waLines[] = ""; $waLines[] = "Terima kasih sudah mempercayakan perangkat Anda ke GMComp π"; $waMsg = implode("\n", $waLines); $waUrl = $phone ? "https://wa.me/{$phone}?text=" . rawurlencode($waMsg) : null; @endphp
Masuk: {{ $order->received_at->format('d F Y, H:i') }}
@if($order->estimated_finish)Est. Selesai: {{ $order->estimated_finish->format('d F Y, H:i') }}
@endif{{ $order->customer?->name }}
@if($order->customer?->phone){{ $order->customer->phone }}
@endif{{ $order->device_type }} {{ $order->device_brand }}
{{ $order->device_model ?: '-' }}
{{ $order->serial_number ?: '-' }}
{{ $order->technician?->name ?? 'Belum Ditentukan' }}
{{ $order->device_condition ?: '-' }}
{{ $order->accessories ?: '-' }}
Rp {{ number_format($order->estimated_cost,0,',','.') }}
β’β’β’β’β’β’β’β’ {{ $order->device_password }}
{{ $order->complaint }}
Diagnosa: {{ $order->diagnosis->diagnosis }}
@if($order->diagnosis->action_plan)Tindakan: {{ $order->diagnosis->action_plan }}
@endif @if($order->diagnosis->estimated_cost)Est. Biaya: Rp {{ number_format($order->diagnosis->estimated_cost,0,',','.') }}
@endif{{ $order->diagnosis->diagnosed_at?->format('d/m/Y H:i') }}
Belum ada diagnosa.
@endif @if($order->technician_notes)Catatan Teknisi
{{ $order->technician_notes }}
| {{ $sp->product?->name }} | {{ $sp->quantity }} Γ Rp {{ number_format($sp->unit_price,0,',','.') }} | Rp {{ number_format($sp->subtotal,0,',','.') }} | @if($order->isEditable())@endif |
| Belum ada sparepart. | |||
| {{ $ch->description }} | Rp {{ number_format($ch->amount,0,',','.') }} | @if($order->isEditable())@endif |
| Belum ada biaya servis. | ||
Total Biaya
Rp {{ number_format($finalCost,0,',','.') }}
Kembalian: Rp {{ number_format($order->change_amount,0,',','.') }}
@endif