@extends('admin.layout.template') @section('title', 'Project Details') @section('content')
{{-- ================= PROJECT HEADER ================= --}}
{{-- LEFT SIDE --}}

{{ $project->project_name }} {{ $project->project_number }}

Customer : {{ $project->customer_name }}

Phone : {{ $project->customer_phone }}

Address : {{ $project->address }}

Project Type : {{ $project->project_type ?? '-' }}

Expected Completion : {{ $project->expected_completion_date ? \Carbon\Carbon::parse($project->expected_completion_date)->format('d M Y') : '-' }}

Status : {{ ucfirst($project->status) }}

{{-- RIGHT SIDE --}}

Employee : {{ $project->employee_name ?? '-' }}

Contact : {{ $project->employee_contact ?? '-' }}

{{-- PDF Buttons --}}
{{-- Upload / Update --}} {{-- View Quotation (if exists) --}} @if($project->quotation_pdf) View @endif {{-- More Actions Dropdown --}}
Subtotal

₹ {{ number_format($project->subtotal, 2) }}

GST (18%)

₹ {{ number_format($project->tax, 2) }}

Grand Total

₹ {{ number_format($project->grand_total, 2) }}

{{-- ================= PROJECT SUMMARY ================= --}}
Total Areas

{{ $project->areas->count() }}

Total Items

{{ $project->areas->sum(fn($area) => $area->items->count()) }}

Total Amount Entered
{{ $project->total_amount }}
{{-- ================= AREAS LOOP ================= --}} @foreach($project->areas as $area)
Area: {{ $area->name }} @if($area->room) (Room: {{ $area->room->name }}) @endif
@if($area->items->count() > 0)
@foreach($area->items as $index => $item) @php $unit = 'Nos'; $qty = 1; // =============================== // NON CUSTOM // =============================== if($item->is_custom == 0){ $qty = (float) ($item->quantity ?? 1); if($item->category == 'curtain'){ $unit = 'Pcs'; } elseif($item->category == 'wallpaper'){ $unit = 'Rolls'; } } // =============================== // CUSTOM CURTAIN // =============================== elseif($item->category == 'curtain' && $item->curtain && $item->measurement){ $fw = (float) $item->curtain->fabric_width; $ww = (float) $item->measurement->width; $wh = (float) $item->measurement->height; if($fw > 0){ $panels = ceil($ww / $fw); $qty = $panels * $wh; } $unit = 'Meter'; } // =============================== // CUSTOM WALLPAPER // =============================== elseif($item->category == 'wallpaper' && $item->wallpaper){ $rw = (float) $item->wallpaper->roll_width; $rl = (float) $item->wallpaper->roll_length; $ww = (float) $item->wallpaper->wall_width; $wh = (float) $item->wallpaper->wall_height; $rep = (float) ($item->wallpaper->design_repeat ?? 0); if($rw > 0 && $rl > 0){ $cuttings = ceil($ww / $rw); $totalLength = $cuttings * ($wh + $rep); $qty = ceil($totalLength / $rl); } $unit = 'Rolls'; } @endphp {{-- SL --}} {{-- IMAGE --}} {{-- PRODUCT --}} {{-- TYPE (is_custom badge) --}} {{-- UNIT --}} {{-- QTY --}} {{-- SIZE --}} {{-- ROOM --}} {{-- CATEGORY --}} {{-- CATALOG --}} {{-- SERIAL --}} {{-- DESCRIPTION --}} @endforeach
# Image Product Type Unit Qty Size Room Item Catalog Serial Description
{{ $index + 1 }} @if($item->is_custom == 0 && $item->variant?->primaryImage?->image_path) @else Custom @endif {{ $item->product->name ?? 'Custom Item' }} @if($item->is_custom == 1) Custom @else Standard @endif {{ $unit }}{{ $qty > 0 ? number_format($qty,2) : '-' }} @if($item->measurement) {{ $item->measurement->width ?? '-' }} x {{ $item->measurement->height ?? '-' }} {{ $item->measurement->unit ?? '' }} @else - @endif {{ $area->area_name ?? $area->name ?? '-' }}{{ ucfirst($item->category ?? '-') }} {{ $item->curtain->catalogue ?? $item->wallpaper->catalogue ?? '-' }} {{ $item->curtain->serial_no ?? $item->wallpaper->serial_no ?? '-' }} {{ $item->notes ?? '-' }}
@else

No items found in this area.

@endif
@endforeach Back to Projects
Add / Edit Item
@csrf {{-- Category --}}
{{-- Subcategory (dynamic) --}}
{{-- Catalogue / Product --}}
{{-- Variant / SKU --}}
{{-- Quantity --}}
{{-- Measurement / Details (dynamic container) --}}
{{-- Notes --}}
@endsection