@extends('pdf.layouts.interior') @section('title','Premium Quotation') @section('content')
Room Wise Quotation
@foreach($project->areas as $area)

{{ $area->area_name }}

@foreach($area->items as $item) @if($item->is_custom == 0) @if($item->category == 'curtain') @elseif($item->category == 'wallpaper') @else @endif @elseif($item->category == 'curtain' && $item->curtain && $item->measurement) @php $fw = (float) $item->curtain->fabric_width; $ww = (float) $item->measurement->width; $wh = (float) $item->measurement->height; $qty = ($fw > 0) ? ceil($ww / $fw) * $wh : 0; @endphp @elseif($item->category == 'wallpaper' && $item->wallpaper) @php $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); $cuttings = ($rw > 0) ? ceil($ww / $rw) : 0; $qty = ($rl > 0) ? ceil(($cuttings * ($wh + $rep)) / $rl) : 0; @endphp @else @endif @php $price = 0.0; $total = 0.0; if ($item->is_custom == 0) { $price = (float) ($item->variant?->offer_price ?? 0); $qty = (int) ($item->quantity ?? 1); $total = $price * $qty; } else { // 🟢 CUSTOM CURTAIN if ($item->category === 'curtain' && $item->curtain && $item->measurement) { $fabricWidth = (float) $item->curtain->fabric_width; $pricePerMeter = (float) $item->curtain->price_per_meter; $wallWidth = (float) $item->measurement->width; $wallHeight = (float) $item->measurement->height; if ($fabricWidth > 0 && $wallWidth > 0 && $wallHeight > 0) { $panels = ceil($wallWidth / $fabricWidth); $fabricRequired = $panels * $wallHeight; $price = $pricePerMeter; $total = $fabricRequired * $pricePerMeter; } } // 🟢 CUSTOM WALLPAPER if ($item->category === 'wallpaper' && $item->wallpaper) { $rollWidth = (float) $item->wallpaper->roll_width; $rollLength = (float) $item->wallpaper->roll_length; $pricePerRoll = (float) $item->wallpaper->price_per_roll; $wallWidth = (float) $item->wallpaper->wall_width; $wallHeight = (float) $item->wallpaper->wall_height; $repeat = (float) ($item->wallpaper->design_repeat ?? 0); if ($rollWidth > 0 && $rollLength > 0) { $cuttings = ceil($wallWidth / $rollWidth); $cuttingHeight = $wallHeight + $repeat; $totalLength = $cuttings * $cuttingHeight; $rolls = ceil($totalLength / $rollLength); $price = $pricePerRoll; $total = $rolls * $pricePerRoll; } } } @endphp @endforeach
Img Item Size Qty Rate Total
@if($item->variant && $item->variant->primaryImage) @endif {{ ucfirst($item->category) }} @if($item->measurement) {{ $item->measurement->width }} x {{ $item->measurement->height }} @else - @endif {{ $item->quantity }} pcs{{ $item->quantity }} rolls{{ $item->quantity }}{{ $qty > 0 ? number_format($qty,2).' m' : '-' }}{{ $qty > 0 ? $qty.' rolls' : '-' }}-{{ $price > 0 ? number_format($price, 2) : '-' }} {{ $total > 0 ? number_format($total, 2) : '-' }}
@endforeach
Subtotal : {{ number_format($project->subtotal,2) }}
GST : {{ number_format($project->tax,2) }}
Grand Total : {{ number_format($project->grand_total,2) }}
Terms & Conditions
{!! $project->terms !!}
@endsection