@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 ?? '-' }}

@php $creator = $project->creator; $company = null; if(in_array($creator->user_type,['architect_staff','dealer_staff'])){ $company = $creator->manager?->businessProfile; }else{ $company = $creator->businessProfile; } @endphp

Created By : {{ $creator->name ?? '-' }} {{ $creator->role->name ?? '' }}

@if($company)

Company : {{ $company->legal_shop_name ?? '-' }} , Type : {{ ucfirst($company->business_type ?? '-') }} , Phone : {{ $company->shop_mobile_number ?? '-' }} , Address : {{ $company->legal_shop_address ?? '-' }}

@endif {{-- PDF Buttons --}}
{{-- Upload / Update --}} {{-- More Actions Dropdown --}}
{{-- ================= PROJECT LOCATION ================= --}}
Project Location
{{-- ================= PROJECT SUMMARY ================= --}}
Subtotal

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

GST (18%)

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

Grand Total

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

Total Areas

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

Total Items

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

{{-- ================= 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 Details 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 ?? '-' }} {{-- CURTAIN --}} @if($item->category == 'curtain' && $item->curtain) {{ $item->curtain->productModel->name ?? $item->curtain->custom_model_name ?? 'Curtain' }} {{-- WALLPAPER --}} @elseif($item->category == 'wallpaper' && $item->wallpaper) {{ $item->wallpaper->catalogue ?? 'Wallpaper' }} {{-- MATTRESS --}} @elseif($item->category == 'mattress' && $item->mattress) {{ $item->mattress->type ?? 'Mattress' }} {{-- DEFAULT --}} @else {{ ucfirst($item->category ?? '-') }} @endif {{ $item->curtain->catalogue ?? $item->wallpaper->catalogue ?? '-' }} @if($item->category == 'fabric') {{ $item->product->master_catalogue_name ?? '-' }} @endif {{ $item->curtain->serial_no ?? $item->wallpaper->serial_no ?? '-' }} @if($item->category == 'fabric') {{ $item->variant->sku ?? '-' }} @endif @if($item->category == 'curtain' && $item->curtain) Brand: {{ $item->curtain->brand ?? '-' }}
Catalog: {{ $item->curtain->catalogue ?? '-' }}
Serial: {{ $item->curtain->serial_no ?? '-' }}
@if($item->is_custom) Fabric Width: {{ $item->curtain->fabric_width ?? '-' }}
Rate: {{ $item->curtain->price_per_meter ?? '-' }} @endif @elseif($item->category == 'wallpaper' && $item->wallpaper) Brand: {{ $item->wallpaper->brand ?? '-' }}
Roll Size: {{ $item->wallpaper->roll_width ?? '-' }} x {{ $item->wallpaper->roll_length ?? '-' }} @else {{ $item->notes ?? '-' }} @endif
{{ $item->notes ?? '-' }}
@else

No items found in this area.

@endif
@endforeach
Status History
@forelse($project->statusHistories as $history) @empty @endforelse
Date Changed By Old Status New Status Remarks
{{ $history->created_at->format('d M Y h:i A') }} {{ $history->user->name }} {{ ucwords(str_replace('_',' ',$history->old_status)) }} {{ ucwords(str_replace('_',' ',$history->new_status)) }} {{ $history->remarks ?? '-' }}
No history found
Back to Projects
@endsection