@extends('layouts.app') @section('title', 'PC Build — ' . $build->build_no) @section('breadcrumb') @endsection @section('content') @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
{{-- Left: Customer + Status --}}
Build Details
@if($build->customer_phone || $build->customer?->phone) @endif
Customer {{ $build->customer?->name ?? $build->customer_name ?? 'Walk-in' }}
Phone {{ $build->customer?->phone ?? $build->customer_phone }}
Status @php $badge = match($build->status) { 'draft' => 'secondary', 'quoted' => 'info', 'confirmed' => 'primary', 'built' => 'warning', 'sold' => 'success', 'cancelled' => 'danger', default => 'secondary', }; @endphp {{ ucfirst($build->status) }}
Created By {{ $build->creator?->name ?? '—' }}
Date {{ $build->created_at->format('d M Y, h:i A') }}
@if($build->notes)
Notes: {{ $build->notes }}
@endif
{{-- Price Summary --}}
Price Summary
Total Cost ৳{{ number_format($build->total_cost_price, 2) }}
Selling Price ৳{{ number_format($build->total_selling_price, 2) }}
Discount −৳{{ number_format($build->discount, 2) }}
Final Price ৳{{ number_format($build->final_price, 2) }}
Profit ৳{{ number_format($build->total_profit, 2) }}
Margin {{ $build->total_selling_price > 0 ? number_format(($build->total_profit / $build->total_selling_price) * 100, 1) : 0 }}%
@if($build->status === 'sold' && $build->convertedSale)
View Linked Sale @endif @if($build->status === 'quoted' && $build->convertedQuotation)
View Linked Quotation @endif
{{-- Right: Components List --}}
Components
@foreach($build->items as $item) @endforeach
Type Component Serial No Qty Cost Selling Profit
{{ $componentTypes[$item->component_type] ?? ucfirst($item->component_type) }} {{ $item->component_name }} @if($item->productVariant)
SKU: {{ $item->productVariant->sku }}
@endif
{{ $item->serial_no ?? '—' }} {{ $item->qty }} ৳{{ number_format($item->total_cost_price, 2) }} ৳{{ number_format($item->total_selling_price, 2) }} ৳{{ number_format($item->profit, 2) }}
Total ৳{{ number_format($build->total_cost_price, 2) }} ৳{{ number_format($build->total_selling_price, 2) }} ৳{{ number_format($build->total_profit, 2) }}
@endsection