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

@if($project->creator) @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 @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 $calc = $item->calculation ?? []; $qty = $calc['qty'] ?? 0; $rate = $calc['rate'] ?? 0; $unit = 'Nos'; if($item->category == 'curtain'){ $unit = 'Mtr'; } elseif($item->category == 'wallpaper'){ $unit = 'Rolls'; } elseif($item->category == 'blinds'){ $unit = 'Sqft'; } @endphp {{-- IMAGE --}} {{-- PRODUCT --}} {{-- TYPE --}} {{-- UNIT --}} {{-- QTY --}} {{-- SIZE --}} {{-- ROOM --}} {{-- CATEGORY --}} {{-- CATALOG --}} {{-- SERIAL / SKU --}} {{-- 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) 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 ?? '-' }} @if($item->category == 'curtain' && $item->curtain) {{ $item->curtain->productModel->name ?? $item->curtain->custom_model_name ?? 'Curtain' }} @elseif($item->category == 'wallpaper') {{ $item->wallpaper->catalogue ?? 'Wallpaper' }} @elseif($item->category == 'mattress') {{ $item->mattress->type ?? 'Mattress' }} @else {{ ucfirst($item->category ?? '-') }} @endif @if($item->category == 'fabric') {{ $item->product->master_catalogue_name ?? '-' }} @else {{ $item->curtain->catalogue ?? $item->wallpaper->catalogue ?? '-' }} @endif @if($item->category == 'fabric') {{ $item->variant->sku ?? '-' }} @else {{ $item->curtain->serial_no ?? $item->wallpaper->serial_no ?? '-' }} @endif {{-- CURTAIN --}} @if($item->category == 'curtain' && $item->curtain) @php $curtainFields = [ 'type' => 'Type', 'motorized' => 'Motorized', 'motor_control' => 'Motor Control', 'model' => 'Model', 'custom_model_name' => 'Custom Model', 'catalogue' => 'Catalogue', 'serial_no' => 'Serial No', 'brand' => 'Brand', 'model_price' => 'Model Price', 'fabric_width' => 'Fabric Width', 'price_per_meter' => 'Price / Meter', 'unit' => 'Unit', ]; @endphp @foreach($curtainFields as $field => $label) @if(!empty($item->curtain->$field)) {{ $label }}: {{ $item->curtain->$field }}
@endif @endforeach @endif {{-- WALLPAPER --}} @if($item->category == 'wallpaper' && $item->wallpaper) @php $wallpaperFields = [ 'brand' => 'Brand', 'catalogue' => 'Catalogue', 'serial_no' => 'Serial No', 'roll_width' => 'Roll Width', 'roll_length' => 'Roll Length', 'design_repeat' => 'Design Repeat', 'price_per_roll' => 'Price / Roll', 'wall_width' => 'Wall Width', 'wall_height' => 'Wall Height', 'rolls_required' => 'Rolls Required', ]; @endphp @foreach($wallpaperFields as $field => $label) @if(!empty($item->wallpaper->$field)) {{ $label }}: {{ $item->wallpaper->$field }}
@endif @endforeach @endif {{-- MATTRESS --}} @if($item->category == 'mattress' && $item->mattress) @php $mattressFields = [ 'type' => 'Type', 'thickness' => 'Thickness', 'size' => 'Size', 'unit' => 'Unit', ]; @endphp @foreach($mattressFields as $field => $label) @if(!empty($item->mattress->$field)) {{ $label }}: {{ $item->mattress->$field }}
@endif @endforeach @endif {{-- MEASUREMENT --}} @if($item->measurement) @php $measurementFields = [ 'width' => 'Width', 'height' => 'Height', 'length' => 'Length', 'size' => 'Size', 'measurement_type' => 'Type', 'unit' => 'Unit', ]; @endphp @foreach($measurementFields as $field => $label) @if(!empty($item->measurement->$field)) {{ $label }}: {{ $item->measurement->$field }}
@endif @endforeach @endif {{-- NOTES --}} @if(!empty($item->notes)) Notes: {{ $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